Skip to content

Commit 64b7794

Browse files
committed
[bugfix] Fix zooming in in Firefox
1 parent ccccb50 commit 64b7794

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Field.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@
155155
return d;
156156
},
157157
updateCanvasWidth() {
158-
this.canvasWidth = this.$refs.canvas.clientWidth;
158+
// Firefox does not support clientWidth for SVG, so fall back to the parent element
159+
this.canvasWidth = this.$refs.canvas.clientWidth || this.$refs.canvas.parentNode.clientWidth;
159160
},
160161
updateCanvasHeight() {
161-
this.canvasHeight = this.$refs.canvas.clientHeight;
162+
// Firefox does not support clientWidth for SVG, so fall back to the parent element
163+
this.canvasHeight = this.$refs.canvas.clientHeight || this.$refs.canvas.parentNode.clientHeight;
162164
},
163165
textTransform(p) {
164166
if (this.rotateField) {

0 commit comments

Comments
 (0)