From 867935d1853c5899d30581b38ac173c62d9ddf6f Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 13 Jun 2019 11:38:02 -0400 Subject: [PATCH 1/2] Force an update after zooming to fit to make scrollbars update. Fixes https://github.com/LLK/scratch-paint/issues/851 --- src/containers/paper-canvas.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index 40a19880..fe861845 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -153,6 +153,7 @@ class PaperCanvas extends React.Component { } else if (this.shouldZoomToFit === true) { zoomToFit(isBitmapMode); } + this.props.updateViewBounds(paper.view.matrix); this.shouldZoomToFit = false; } importSvg (svg, rotationCenterX, rotationCenterY) { From fc08becbf3bdf4f7b5752e2f7d15af8fee614bee Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 21 Jun 2019 08:56:32 -0400 Subject: [PATCH 2/2] Only update view bounds if zoomToFit was truthy --- src/containers/paper-canvas.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index fe861845..41dff0e7 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -150,10 +150,11 @@ class PaperCanvas extends React.Component { maybeZoomToFit (isBitmapMode) { if (this.shouldZoomToFit instanceof paper.Matrix) { paper.view.matrix = this.shouldZoomToFit; + this.props.updateViewBounds(paper.view.matrix); } else if (this.shouldZoomToFit === true) { zoomToFit(isBitmapMode); + this.props.updateViewBounds(paper.view.matrix); } - this.props.updateViewBounds(paper.view.matrix); this.shouldZoomToFit = false; } importSvg (svg, rotationCenterX, rotationCenterY) {