Always scroll center on zoom reset (#4725)

* Always scroll center on zoom reset
This commit is contained in:
Monica Kozbial
2021-03-24 10:08:42 -07:00
committed by GitHub
parent babf940ef5
commit b6628da5bb

View File

@@ -462,9 +462,9 @@ Blockly.ZoomControls.prototype.resetZoom_ = function(e) {
// Math.log computes natural logarithm (ln), to change the base, use formula:
// log(base, value) = ln(value) / ln(base)
var amount = Math.log(targetScale / currentScale) / Math.log(speed);
this.workspace_.beginCanvasTransition();
this.workspace_.zoomCenter(amount);
this.workspace_.scrollCenter();
setTimeout(this.workspace_.endCanvasTransition.bind(this.workspace_), 500);
this.fireZoomEvent_();