mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Merge pull request #2690 from rachel-fenichel/border_rect_default_height
Define BORDER_RECT_DEFAULT_HEIGHT constant
This commit is contained in:
@@ -117,6 +117,13 @@ Blockly.Field.cacheWidths_ = null;
|
||||
*/
|
||||
Blockly.Field.cacheReference_ = 0;
|
||||
|
||||
/**
|
||||
* The default height of the border rect on any field.
|
||||
* @type {number}
|
||||
* @package
|
||||
*/
|
||||
Blockly.Field.BORDER_RECT_DEFAULT_HEIGHT = 16;
|
||||
|
||||
/**
|
||||
* Name of field. Unique within each block.
|
||||
* Static labels are usually unnamed.
|
||||
@@ -278,7 +285,7 @@ Blockly.Field.prototype.createBorderRect_ = function() {
|
||||
'ry': 4,
|
||||
'x': -Blockly.BlockSvg.SEP_SPACE_X / 2,
|
||||
'y': 0,
|
||||
'height': 16,
|
||||
'height': Blockly.Field.BORDER_RECT_DEFAULT_HEIGHT,
|
||||
'width': this.size_.width + Blockly.BlockSvg.SEP_SPACE_X
|
||||
}, this.fieldGroup_);
|
||||
};
|
||||
|
||||
@@ -437,7 +437,8 @@ Blockly.FieldTextInput.prototype.getCorrectedSize = function() {
|
||||
// the logic to figure out whether to rerender, just call getSize.
|
||||
this.getSize();
|
||||
// TODO (#2562): Remove getCorrectedSize.
|
||||
return new goog.math.Size(this.size_.width + Blockly.BlockSvg.SEP_SPACE_X, 16);
|
||||
return new goog.math.Size(this.size_.width + Blockly.BlockSvg.SEP_SPACE_X,
|
||||
Blockly.Field.BORDER_RECT_DEFAULT_HEIGHT);
|
||||
};
|
||||
|
||||
Blockly.Field.register('field_input', Blockly.FieldTextInput);
|
||||
|
||||
Reference in New Issue
Block a user