mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Fix width on dummy row.
This commit is contained in:
@@ -228,15 +228,16 @@ Blockly.geras.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
|
||||
*/
|
||||
Blockly.geras.RenderInfo.prototype.addAlignmentPadding_ = function(row, missingSpace) {
|
||||
var elems = row.elements;
|
||||
var firstSpacer = row.getFirstSpacer();
|
||||
var lastSpacer = row.getLastSpacer();
|
||||
if (row.hasExternalInput || row.hasStatement) {
|
||||
// Get the spacer right before the input socket.
|
||||
lastSpacer = elems[elems.length - 3];
|
||||
row.widthWithConnectedBlocks += missingSpace;
|
||||
}
|
||||
|
||||
var input = row.getLastInput();
|
||||
if (input) {
|
||||
var firstSpacer = row.getFirstSpacer();
|
||||
var lastSpacer = row.getLastSpacer();
|
||||
if (row.hasExternalInput || row.hasStatement) {
|
||||
// Get the spacer right before the input socket.
|
||||
lastSpacer = elems[elems.length - 3];
|
||||
row.widthWithConnectedBlocks += missingSpace;
|
||||
}
|
||||
// Decide where the extra padding goes.
|
||||
if (input.align == Blockly.ALIGN_LEFT) {
|
||||
// Add padding to the end of the row.
|
||||
@@ -249,12 +250,11 @@ Blockly.geras.RenderInfo.prototype.addAlignmentPadding_ = function(row, missingS
|
||||
// Add padding at the beginning of the row.
|
||||
firstSpacer.width += missingSpace;
|
||||
}
|
||||
row.width += missingSpace;
|
||||
// Top and bottom rows are always left aligned.
|
||||
} else if (row.type == 'top row' || row.type == 'bottom row') {
|
||||
row.getLastSpacer().width += missingSpace;
|
||||
row.width += missingSpace;
|
||||
} else {
|
||||
// Default to left-aligning if there's no input to say where to align.
|
||||
lastSpacer.width += missingSpace;
|
||||
}
|
||||
row.width += missingSpace;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -227,14 +227,17 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
|
||||
* @override
|
||||
*/
|
||||
Blockly.thrasos.RenderInfo.prototype.addAlignmentPadding_ = function(row, missingSpace) {
|
||||
var elems = row.elements;
|
||||
var firstSpacer = row.getFirstSpacer();
|
||||
var lastSpacer = row.getLastSpacer();
|
||||
if (row.hasExternalInput || row.hasStatement) {
|
||||
// Get the spacer right before the input socket.
|
||||
lastSpacer = elems[elems.length - 3];
|
||||
row.widthWithConnectedBlocks += missingSpace;
|
||||
}
|
||||
|
||||
var input = row.getLastInput();
|
||||
if (input) {
|
||||
var firstSpacer = row.getFirstSpacer();
|
||||
var lastSpacer = row.getLastSpacer();
|
||||
if (row.hasExternalInput || row.hasStatement) {
|
||||
// Get the spacer right before the input socket.
|
||||
row.widthWithConnectedBlocks += missingSpace;
|
||||
}
|
||||
// Decide where the extra padding goes.
|
||||
if (input.align == Blockly.ALIGN_LEFT) {
|
||||
// Add padding to the end of the row.
|
||||
@@ -247,12 +250,11 @@ Blockly.thrasos.RenderInfo.prototype.addAlignmentPadding_ = function(row, missin
|
||||
// Add padding at the beginning of the row.
|
||||
firstSpacer.width += missingSpace;
|
||||
}
|
||||
row.width += missingSpace;
|
||||
// Top and bottom rows are always left aligned.
|
||||
} else if (row.type == 'top row' || row.type == 'bottom row') {
|
||||
row.getLastSpacer().width += missingSpace;
|
||||
row.width += missingSpace;
|
||||
} else {
|
||||
// Default to left-aligning if there's no input to say where to align.
|
||||
lastSpacer.width += missingSpace;
|
||||
}
|
||||
row.width += missingSpace;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user