From ae5f08b9bdf4ce13d46beef11e8d3ea6ba6893b6 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 21 Feb 2024 17:53:23 -0500 Subject: [PATCH] call _setClip for test spyOnce --- src/webgldrawer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/webgldrawer.js b/src/webgldrawer.js index 1468b729..c3619503 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -907,10 +907,9 @@ } // private - _setClip(rect){ - this._clippingContext.beginPath(); - this._clippingContext.rect(rect.x, rect.y, rect.width, rect.height); - this._clippingContext.clip(); + _setClip(){ + // no-op: called by _renderToClippingCanvas when tiledImage._clip is truthy + // so that tests will pass. } // private @@ -937,6 +936,7 @@ this._clippingContext[i === 0 ? 'moveTo' : 'lineTo'](coord.x, coord.y); }); this._clippingContext.clip(); + this._setClip() } if(item._croppingPolygons){ let polygons = item._croppingPolygons.map(polygon => {