Fix toolbox sizes not being updated properly (#4139)

* Fix toolbox changing size

* Fix flyout changing size

* Fix mutator bumping blocks

* Fix accessing .flyout_
This commit is contained in:
Beka Westberg
2020-08-13 08:19:40 -07:00
committed by GitHub
parent f8f98831af
commit 111b47980d
4 changed files with 50 additions and 7 deletions

View File

@@ -472,9 +472,19 @@ Blockly.Toolbox.prototype.handleAfterTreeSelected_ = function(
* @private
*/
Blockly.Toolbox.prototype.handleNodeSizeChanged_ = function() {
// Reposition the workspace so that (0,0) is in the correct position relative
// to the new absolute edge (ie toolbox edge).
var workspace = this.workspace_;
var rect = this.HtmlDiv.getBoundingClientRect();
var newX = this.toolboxPosition == Blockly.TOOLBOX_AT_LEFT ?
workspace.scrollX + rect.width : 0;
var newY = this.toolboxPosition == Blockly.TOOLBOX_AT_TOP ?
workspace.scrollY + rect.height : 0;
workspace.translate(newX, newY);
// Even though the div hasn't changed size, the visible workspace
// surface of the workspace has, so we may need to reposition everything.
Blockly.svgResize(this.workspace_);
Blockly.svgResize(workspace);
};
/**