File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,7 +272,10 @@ class Renderer2D extends Renderer {
272272 } ) ;
273273 shape . accept ( visitor ) ;
274274 if ( this . _clipping ) {
275- this . clipPath . addPath ( visitor . path ) ;
275+ const currentTransform = this . drawingContext . getTransform ( ) ;
276+ const clipBaseTransform = this . _clipBaseTransform . inverse ( ) ;
277+ const relativeTransform = clipBaseTransform . multiply ( currentTransform ) ;
278+ this . clipPath . addPath ( visitor . path , relativeTransform ) ;
276279 this . clipPath . closePath ( ) ;
277280 } else {
278281 if ( this . states . fillColor ) {
@@ -286,7 +289,7 @@ class Renderer2D extends Renderer {
286289
287290 beginClip ( options = { } ) {
288291 super . beginClip ( options ) ;
289-
292+ this . _clipBaseTransform = this . drawingContext . getTransform ( ) ;
290293 // cache the fill style
291294 this . states . setValue ( '_cachedFillStyle' , this . drawingContext . fillStyle ) ;
292295 const newFill = this . _pInst . color ( 255 , 0 ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments