Removed accessing private flyout.width_ variable.

This commit is contained in:
Beka Westberg
2019-02-26 16:33:18 -08:00
parent a0aa84d861
commit 69718f2fd4
2 changed files with 6 additions and 5 deletions

View File

@@ -272,7 +272,7 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
this.rootBlock_.setDeletable(false);
if (this.workspace_.flyout_) {
var margin = this.workspace_.flyout_.CORNER_RADIUS * 2;
var x = this.workspace_.flyout_.width_ + margin;
var x = this.workspace_.getFlyout_().getWidth() + margin;
} else {
var margin = 16;
var x = margin;
@@ -385,9 +385,10 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() {
Blockly.Mutator.prototype.getFlyoutMetrics_ = function() {
return {
viewHeight: this.workspaceHeight_,
viewWidth: this.workspaceWidth_ - this.workspace_.flyout_.width_,
viewWidth: this.workspaceWidth_ - this.workspace_.getFlyout_().getWidth(),
absoluteTop: 0,
absoluteLeft: this.workspace_.RTL ? 0 : this.workspace_.flyout_.width_
absoluteLeft: this.workspace_.RTL ? 0 :
this.workspace_.getFlyout_().getWidth()
};
};

View File

@@ -1733,9 +1733,9 @@ Blockly.WorkspaceSvg.prototype.zoomToFit = function() {
// Convert from pixels to workspace coordinates.
blocksHeight += this.flyout_.height_ / this.scale;
} else {
workspaceWidth += this.flyout_.width_;
workspaceWidth += this.flyout_.getWidth();
// Convert from pixels to workspace coordinates.
blocksWidth += this.flyout_.width_ / this.scale;
blocksWidth += this.flyout_.getWidth() / this.scale;
}
}