@@ -1817,7 +1817,6 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
18171817 draw : function ( item , ctx , param ) {
18181818 if ( ! item . _visible || item . _opacity == 0 )
18191819 return ;
1820-
18211820 var tempCanvas , parentCtx ;
18221821 // If the item has a blendMode or is defining an opacity, draw it on
18231822 // a temporary canvas first and composite the canvas afterwards.
@@ -1832,21 +1831,17 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
18321831 var bounds = item . getStrokeBounds ( ) || item . getBounds ( ) ;
18331832 if ( ! bounds . width || ! bounds . height )
18341833 return ;
1835-
18361834 // Floor the offset and ceil the size, so we don't cut off any
18371835 // antialiased pixels when drawing onto the temporary canvas.
18381836 var itemOffset = bounds . getTopLeft ( ) . floor ( ) ,
18391837 size = bounds . getSize ( ) . ceil ( ) . add ( new Size ( 1 , 1 ) ) ;
18401838 tempCanvas = CanvasProvider . getCanvas ( size ) ;
1841-
18421839 // Save the parent context, so we can draw onto it later
18431840 parentCtx = ctx ;
1844-
18451841 // Set ctx to the context of the temporary canvas,
18461842 // so we draw onto it, instead of the parentCtx
18471843 ctx = tempCanvas . getContext ( '2d' ) ;
18481844 ctx . save ( ) ;
1849-
18501845 // Translate the context so the topLeft of the item is at (0, 0)
18511846 // on the temporary canvas.
18521847 ctx . translate ( - itemOffset . x , - itemOffset . y ) ;
@@ -1859,15 +1854,12 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
18591854 item . draw ( ctx , param ) ;
18601855 if ( itemOffset )
18611856 param . offset = savedOffset ;
1862-
18631857 // If we created a temporary canvas before, composite it onto the
18641858 // parent canvas:
18651859 if ( tempCanvas ) {
1866-
18671860 // Restore the temporary canvas to its state before the
18681861 // translation matrix was applied above.
18691862 ctx . restore ( ) ;
1870-
18711863 // If the item has a blendMode, use BlendMode#process to
18721864 // composite its canvas on the parentCanvas.
18731865 if ( item . _blendMode !== 'normal' ) {
@@ -1885,7 +1877,6 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
18851877 itemOffset . x , itemOffset . y ) ;
18861878 parentCtx . restore ( ) ;
18871879 }
1888-
18891880 // Return the temporary canvas, so it can be reused
18901881 CanvasProvider . returnCanvas ( tempCanvas ) ;
18911882 }
0 commit comments