From 24866deae918d59dc2fb8cc1bc57e1bf091ce3b3 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Tue, 23 Jul 2019 13:38:28 -0700 Subject: [PATCH] Use BORDER_RECT_DEFAULT_HEIGHT constant --- core/field.js | 9 ++++++++- core/field_textinput.js | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/field.js b/core/field.js index 1abbafa1e..1ff332c76 100644 --- a/core/field.js +++ b/core/field.js @@ -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_); }; diff --git a/core/field_textinput.js b/core/field_textinput.js index 39c3061e2..face3b61e 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -442,7 +442,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);