mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
Add overrideable function to get flyout scale (#4647)
This commit is contained in:
committed by
GitHub
parent
b00db4c033
commit
4fd6d1b229
@@ -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.
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user