diff --git a/src/display/canvas.js b/src/display/canvas.js index bcb8516401e29..5f5d04dd5ccf0 100644 --- a/src/display/canvas.js +++ b/src/display/canvas.js @@ -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) {