mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
@@ -203,6 +203,14 @@ Blockly.FlyoutButton.prototype.moveTo = function(x, y) {
|
||||
this.updateTransform_();
|
||||
};
|
||||
|
||||
/**
|
||||
* Location of the button.
|
||||
* @return {!goog.math.Coordinate} x, y coordinates.
|
||||
*/
|
||||
Blockly.FlyoutButton.prototype.getPosition = function() {
|
||||
return this.position_;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the button's target workspace.
|
||||
* @return {!Blockly.WorkspaceSvg} The target workspace of the flyout where this
|
||||
|
||||
@@ -353,14 +353,23 @@ Blockly.VerticalFlyout.prototype.reflowInternal_ = function() {
|
||||
if (this.RTL) {
|
||||
// With the flyoutWidth known, right-align the blocks.
|
||||
var oldX = block.getRelativeToSurfaceXY().x;
|
||||
var newX = flyoutWidth / this.workspace_.scale - this.MARGIN;
|
||||
newX -= Blockly.BlockSvg.TAB_WIDTH;
|
||||
var newX = flyoutWidth / this.workspace_.scale - this.MARGIN -
|
||||
Blockly.BlockSvg.TAB_WIDTH;
|
||||
block.moveBy(newX - oldX, 0);
|
||||
}
|
||||
if (block.flyoutRect_) {
|
||||
this.moveRectToBlock_(block.flyoutRect_, block);
|
||||
}
|
||||
}
|
||||
if (this.RTL) {
|
||||
// With the flyoutWidth known, right-align the buttons.
|
||||
for (var i = 0, button; button = this.buttons_[i]; i++) {
|
||||
var y = button.getPosition().y;
|
||||
var x = flyoutWidth - button.width - this.MARGIN -
|
||||
Blockly.BlockSvg.TAB_WIDTH;
|
||||
button.moveTo(x, y);
|
||||
}
|
||||
}
|
||||
// Record the width for .getMetrics_ and .position.
|
||||
this.width_ = flyoutWidth;
|
||||
// Call this since it is possible the trash and zoom buttons need
|
||||
|
||||
Reference in New Issue
Block a user