diff --git a/core/flyout_base.js b/core/flyout_base.js index acd067cff..b017e11e6 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -341,6 +341,15 @@ Blockly.Flyout.prototype.getHeight = function() { return this.height_; }; +/** + * Get the scale (zoom level) of the flyout. By default, + * this matches the target workspace scale, but this can be overridden. + * @return {number} Flyout workspace scale. + */ +Blockly.Flyout.prototype.getFlyoutScale = function() { + return this.targetWorkspace.scale; +}; + /** * Get the workspace inside the flyout. * @return {!Blockly.WorkspaceSvg} The workspace inside the flyout. diff --git a/core/flyout_horizontal.js b/core/flyout_horizontal.js index 90fc45337..af1fefac1 100644 --- a/core/flyout_horizontal.js +++ b/core/flyout_horizontal.js @@ -386,7 +386,7 @@ Blockly.HorizontalFlyout.prototype.getClientRect = function() { * @protected */ Blockly.HorizontalFlyout.prototype.reflowInternal_ = function() { - this.workspace_.scale = this.targetWorkspace.scale; + this.workspace_.scale = this.getFlyoutScale(); var flyoutHeight = 0; var blocks = this.workspace_.getTopBlocks(false); for (var i = 0, block; (block = blocks[i]); i++) { diff --git a/core/flyout_vertical.js b/core/flyout_vertical.js index ac76f8328..f42856a60 100644 --- a/core/flyout_vertical.js +++ b/core/flyout_vertical.js @@ -370,7 +370,7 @@ Blockly.VerticalFlyout.prototype.getClientRect = function() { * @protected */ Blockly.VerticalFlyout.prototype.reflowInternal_ = function() { - this.workspace_.scale = this.targetWorkspace.scale; + this.workspace_.scale = this.getFlyoutScale(); var flyoutWidth = 0; var blocks = this.workspace_.getTopBlocks(false); for (var i = 0, block; (block = blocks[i]); i++) {