mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
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:
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user