mirror of
https://github.com/google/blockly.git
synced 2026-03-08 22:30:09 +01:00
Always scroll center on zoom reset (#4725)
* Always scroll center on zoom reset
This commit is contained in:
@@ -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_();
|
||||
|
||||
Reference in New Issue
Block a user