Skip to content

Commit 7075032

Browse files
committed
Merge pull request #4521 from Snuffleupagus/issue-4260
Assign non-zero width/height to all rectangles (issue 4260)
2 parents 7d5bf83 + 7e7b728 commit 7075032

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/display/canvas.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
975975
this.ctx.closePath();
976976
},
977977
rectangle: function CanvasGraphics_rectangle(x, y, width, height) {
978+
if (width === 0) {
979+
width = this.getSinglePixelWidth();
980+
}
981+
if (height === 0) {
982+
height = this.getSinglePixelWidth();
983+
}
984+
978985
this.ctx.rect(x, y, width, height);
979986
},
980987
stroke: function CanvasGraphics_stroke(consumePath) {

0 commit comments

Comments
 (0)