diff options
Diffstat (limited to 'js/helper-classes/RDGE/GLLine.js')
-rwxr-xr-x | js/helper-classes/RDGE/GLLine.js | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js index f715a43c..5228ac09 100755 --- a/js/helper-classes/RDGE/GLLine.js +++ b/js/helper-classes/RDGE/GLLine.js | |||
@@ -364,41 +364,40 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro | |||
364 | var lineWidth = this._strokeWidth; | 364 | var lineWidth = this._strokeWidth; |
365 | ctx.beginPath(); | 365 | ctx.beginPath(); |
366 | ctx.lineWidth = lineWidth; | 366 | ctx.lineWidth = lineWidth; |
367 | ctx.strokeStyle = "#0000ff"; | ||
368 | if (this._strokeColor) | 367 | if (this._strokeColor) |
369 | { | 368 | { |
370 | var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; | 369 | var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; |
371 | ctx.strokeStyle = c; | 370 | ctx.strokeStyle = c; |
372 | } | ||
373 | 371 | ||
374 | // get the points | 372 | // get the points |
375 | var p0, p1; | 373 | var p0, p1; |
376 | var w = this._width, h = this._height; | 374 | var w = this._width, h = this._height; |
377 | if(this._slope === "vertical") | 375 | if(this._slope === "vertical") |
378 | { | 376 | { |
379 | p0 = [0.5*w, 0]; | 377 | p0 = [0.5*w, 0]; |
380 | p1 = [0.5*w, h]; | 378 | p1 = [0.5*w, h]; |
381 | } | 379 | } |
382 | else if(this._slope === "horizontal") | 380 | else if(this._slope === "horizontal") |
383 | { | 381 | { |
384 | p0 = [0, 0.5*h]; | 382 | p0 = [0, 0.5*h]; |
385 | p1 = [w, 0.5*h]; | 383 | p1 = [w, 0.5*h]; |
386 | } | 384 | } |
387 | else if(this._slope > 0) | 385 | else if(this._slope > 0) |
388 | { | 386 | { |
389 | p0 = [this._xAdj, this._yAdj]; | 387 | p0 = [this._xAdj, this._yAdj]; |
390 | p1 = [w - this._xAdj, h - this._yAdj]; | 388 | p1 = [w - this._xAdj, h - this._yAdj]; |
391 | } | 389 | } |
392 | else | 390 | else |
393 | { | 391 | { |
394 | p0 = [this._xAdj, h - this._yAdj]; | 392 | p0 = [this._xAdj, h - this._yAdj]; |
395 | p1 = [w - this._xAdj, this._yAdj]; | 393 | p1 = [w - this._xAdj, this._yAdj]; |
396 | } | 394 | } |
397 | 395 | ||
398 | // draw the line | 396 | // draw the line |
399 | ctx.moveTo( p0[0], p0[1] ); | 397 | ctx.moveTo( p0[0], p0[1] ); |
400 | ctx.lineTo( p1[0], p1[1] ); | 398 | ctx.lineTo( p1[0], p1[1] ); |
401 | ctx.stroke(); | 399 | ctx.stroke(); |
400 | } | ||
402 | } | 401 | } |
403 | 402 | ||
404 | 403 | ||