diff options
Diffstat (limited to 'js/helper-classes/RDGE/GLRectangle.js')
-rwxr-xr-x | js/helper-classes/RDGE/GLRectangle.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js index cf9c123e..a801d3c4 100755 --- a/js/helper-classes/RDGE/GLRectangle.js +++ b/js/helper-classes/RDGE/GLRectangle.js | |||
@@ -400,27 +400,33 @@ function GLRectangle() | |||
400 | var w = world.getViewportWidth(), | 400 | var w = world.getViewportWidth(), |
401 | h = world.getViewportHeight(); | 401 | h = world.getViewportHeight(); |
402 | 402 | ||
403 | // set the fill | 403 | // render the fill |
404 | ctx.beginPath(); | 404 | ctx.beginPath(); |
405 | if (this._fillColor) | 405 | if (this._fillColor) |
406 | { | 406 | { |
407 | var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")"; | 407 | var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")"; |
408 | ctx.fillStyle = c; | 408 | ctx.fillStyle = c; |
409 | |||
410 | ctx.lineWidth = lw; | ||
411 | var inset = Math.ceil( lw ) + 0.5; | ||
412 | this.renderPath( inset, ctx ); | ||
413 | ctx.fill(); | ||
414 | ctx.closePath(); | ||
409 | } | 415 | } |
410 | 416 | ||
411 | // set the stroke | 417 | // render the stroke |
418 | ctx.beginPath(); | ||
412 | if (this._strokeColor) | 419 | if (this._strokeColor) |
413 | { | 420 | { |
414 | var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; | 421 | var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; |
415 | ctx.strokeStyle = c; | 422 | ctx.strokeStyle = c; |
416 | } | ||
417 | 423 | ||
418 | ctx.lineWidth = lw; | 424 | ctx.lineWidth = lw; |
419 | var inset = Math.ceil( 0.5*lw ) + 0.5; | 425 | var inset = Math.ceil( 0.5*lw ) + 0.5; |
420 | this.renderPath( inset, ctx ); | 426 | this.renderPath( inset, ctx ); |
421 | if (this._fillColor) ctx.fill(); | 427 | ctx.stroke(); |
422 | if (this._strokeColor) ctx.stroke(); | 428 | ctx.closePath(); |
423 | ctx.closePath(); | 429 | } |
424 | } | 430 | } |
425 | 431 | ||
426 | this.createStroke = function(ctr, width, height, strokeWidth, tlRad, blRad, brRad, trRad, material) | 432 | this.createStroke = function(ctr, width, height, strokeWidth, tlRad, blRad, brRad, trRad, material) |