Skip to content

Commit

Permalink
Assign non-zero width/height to all rectangles (issue 4260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffleupagus committed Mar 26, 2014
1 parent 1d0286f commit 7e7b728
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.ctx.closePath();
},
rectangle: function CanvasGraphics_rectangle(x, y, width, height) {
if (width === 0) {
width = this.getSinglePixelWidth();
}
if (height === 0) {
height = this.getSinglePixelWidth();
}

this.ctx.rect(x, y, width, height);
},
stroke: function CanvasGraphics_stroke(consumePath) {
Expand Down

0 comments on commit 7e7b728

Please sign in to comment.