mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Minor refactor in alignRowElements currentWidth and desiredWidth computation.
This commit is contained in:
@@ -537,13 +537,14 @@ Blockly.blockRendering.RenderInfo.prototype.alignRowElements_ = function() {
|
||||
for (var r = 0; r < this.rows.length; r++) {
|
||||
var row = this.rows[r];
|
||||
if (!row.hasInlineInput) {
|
||||
var currentWidth = row.width;
|
||||
if (row.hasStatement) {
|
||||
var statementInput = row.getLastInput();
|
||||
currentWidth -= statementInput.width;
|
||||
var currentWidth = row.width - statementInput.width;
|
||||
var desiredWidth = this.statementEdge - this.startX;
|
||||
} else {
|
||||
var currentWidth = row.width;
|
||||
var desiredWidth = this.width - this.startX;
|
||||
}
|
||||
var desiredWidth = row.hasStatement ? this.statementEdge : this.width;
|
||||
desiredWidth -= this.startX;
|
||||
if (row.type === 'bottom row' && row.hasFixedWidth) {
|
||||
desiredWidth = Blockly.blockRendering.constants.MAX_BOTTOM_WIDTH;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user