mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Fix value to stack width measurement (#3559)
* Include width of connected block in value to stack width measurement.
This commit is contained in:
@@ -754,6 +754,13 @@ Blockly.blockRendering.RenderInfo.prototype.finalize_ = function() {
|
||||
Math.max(widestRowWithConnectedBlocks, row.widthWithConnectedBlocks);
|
||||
this.recordElemPositions_(row);
|
||||
}
|
||||
if (this.outputConnection && this.block_.nextConnection &&
|
||||
this.block_.nextConnection.isConnected()) {
|
||||
// Include width of connected block in value to stack width measurement.
|
||||
widestRowWithConnectedBlocks =
|
||||
Math.max(widestRowWithConnectedBlocks,
|
||||
this.block_.nextConnection.targetBlock().getHeightWidth().width);
|
||||
}
|
||||
|
||||
this.widthWithChildren = Math.max(this.widthWithChildren,
|
||||
widestRowWithConnectedBlocks + this.startX);
|
||||
|
||||
@@ -403,6 +403,15 @@ Blockly.geras.RenderInfo.prototype.finalize_ = function() {
|
||||
}
|
||||
this.recordElemPositions_(row);
|
||||
}
|
||||
if (this.outputConnection && this.block_.nextConnection &&
|
||||
this.block_.nextConnection.isConnected()) {
|
||||
// Include width of connected block in value to stack width measurement.
|
||||
widestRowWithConnectedBlocks =
|
||||
Math.max(widestRowWithConnectedBlocks,
|
||||
this.block_.nextConnection.targetBlock().getHeightWidth().width -
|
||||
this.constants_.DARK_PATH_OFFSET);
|
||||
}
|
||||
|
||||
this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight;
|
||||
|
||||
// The dark (lowlight) adds to the size of the block in both x and y.
|
||||
|
||||
@@ -329,6 +329,13 @@ Blockly.thrasos.RenderInfo.prototype.finalize_ = function() {
|
||||
}
|
||||
this.recordElemPositions_(row);
|
||||
}
|
||||
if (this.outputConnection && this.block_.nextConnection &&
|
||||
this.block_.nextConnection.isConnected()) {
|
||||
// Include width of connected block in value to stack width measurement.
|
||||
widestRowWithConnectedBlocks =
|
||||
Math.max(widestRowWithConnectedBlocks,
|
||||
this.block_.nextConnection.targetBlock().getHeightWidth().width);
|
||||
}
|
||||
|
||||
this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight;
|
||||
this.widthWithChildren = widestRowWithConnectedBlocks + this.startX;
|
||||
|
||||
Reference in New Issue
Block a user