Skip to content

Commit 41477ac

Browse files
committed
Fix up style handling
1 parent bae6ff4 commit 41477ac

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/three/plugins/images/utils/VectorShapeCanvasRenderer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ export class VectorShapeCanvasRenderer {
124124
const offsetX = tileLeft - localOriginX * scaleX;
125125
const offsetY = tileTop - localOriginY * scaleY;
126126

127-
ctx.save();
128127
ctx.setTransform( scaleX, 0, 0, scaleY, offsetX, offsetY );
129128

130129
ctx.beginPath();
131130
ctx.rect( localOriginX, tileExtent ? 0 : tMinY, spanX, spanY );
132131
ctx.clip();
133132

133+
ctx.clearRect( localOriginX, tileExtent ? 0 : tMinY, spanX, spanY );
134+
134135
this._ctx = ctx;
135136
this._invScale = 1 / scaleX;
136137

@@ -144,7 +145,7 @@ export class VectorShapeCanvasRenderer {
144145
this.stroke = style?.stroke ?? DEFAULT_STYLE.stroke;
145146
this.strokeWidth = ( style?.strokeWidth ?? DEFAULT_STYLE.strokeWidth ) * _invScale;
146147
this.radius = ( style?.radius ?? DEFAULT_STYLE.radius ) * _invScale;
147-
this.visible = style?.visible ?? DEFAULT_STYLE.visible;
148+
this.visible = style ? style?.visible ?? DEFAULT_STYLE.visible : false;
148149

149150
}
150151

0 commit comments

Comments
 (0)