diff --git a/js/display/CanvasBlock.js b/js/display/CanvasBlock.js index 57e1f4ef4..7e6787dfe 100644 --- a/js/display/CanvasBlock.js +++ b/js/display/CanvasBlock.js @@ -78,6 +78,8 @@ define( function( require ) { this.canvas.style.width = size.width + 'px'; this.canvas.style.height = size.height + 'px'; this.wrapper.resetStyles(); + this.canvasDrawOffset.setXY( 0, 0 ); + Util.unsetTransform( this.canvas ); }, setSizeFitBounds: function() { diff --git a/js/display/DOMSelfDrawable.js b/js/display/DOMSelfDrawable.js index 003248a45..5961bb183 100644 --- a/js/display/DOMSelfDrawable.js +++ b/js/display/DOMSelfDrawable.js @@ -67,6 +67,8 @@ define( function( require ) { this.domElement.style.visibility = this.visible ? '' : 'hidden'; } + + this.cleanPaintableState && this.cleanPaintableState(); } }, diff --git a/js/display/SVGSelfDrawable.js b/js/display/SVGSelfDrawable.js index 54f343694..db4f6fbd8 100644 --- a/js/display/SVGSelfDrawable.js +++ b/js/display/SVGSelfDrawable.js @@ -129,6 +129,8 @@ define( function( require ) { if ( this.dirtyFill || this.dirtyStroke || strokeDetailDirty ) { element.setAttribute( 'style', this.paintState.baseStyle + this.paintState.strokeDetailStyle ); } + + this.cleanPaintableState(); }, updateSVGBlock: function( svgBlock ) { diff --git a/js/nodes/Circle.js b/js/nodes/Circle.js index 833c4198f..3e7ddf8c0 100644 --- a/js/nodes/Circle.js +++ b/js/nodes/Circle.js @@ -358,6 +358,8 @@ define( function( require ) { setToClean: function() { this.setToCleanState(); + this.cleanPaintableState(); + this.transformDirty = false; }, diff --git a/js/nodes/Line.js b/js/nodes/Line.js index c1c45358f..dd4c4d675 100644 --- a/js/nodes/Line.js +++ b/js/nodes/Line.js @@ -519,7 +519,6 @@ define( function( require ) { context.beginPath(); context.moveTo( node._x1, node._y1 ); context.lineTo( node._x2, node._y2 ); - context.closePath(); if ( node._stroke ) { node.beforeCanvasStroke( wrapper ); // defined in Paintable diff --git a/js/nodes/Rectangle.js b/js/nodes/Rectangle.js index 28e0b7fde..c4f8e043a 100644 --- a/js/nodes/Rectangle.js +++ b/js/nodes/Rectangle.js @@ -738,6 +738,8 @@ define( function( require ) { setToClean: function() { this.setToCleanState(); + this.cleanPaintableState(); + this.transformDirty = false; }, diff --git a/js/nodes/Text.js b/js/nodes/Text.js index bb63d7953..1392ab51a 100644 --- a/js/nodes/Text.js +++ b/js/nodes/Text.js @@ -710,6 +710,8 @@ define( function( require ) { setToClean: function() { this.setToCleanState(); + this.cleanPaintableState(); + this.transformDirty = false; },