From fc4372dbc2aabe8513cb7b263ade4440054861fb Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 22 Jul 2019 16:29:44 -0700 Subject: [PATCH] Add TODOs with github issue number --- core/field.js | 1 + core/field_checkbox.js | 2 ++ core/field_colour.js | 1 + core/field_dropdown.js | 3 +++ core/field_image.js | 2 +- core/field_label.js | 3 +++ core/field_textinput.js | 1 + 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/field.js b/core/field.js index e6b24207d..09ac46fa2 100644 --- a/core/field.js +++ b/core/field.js @@ -650,6 +650,7 @@ Blockly.Field.prototype.getSize = function() { * @package */ Blockly.Field.prototype.getCorrectedSize = function() { + // TODO (#2562): Remove getCorrectedSize. return this.getSize(); }; diff --git a/core/field_checkbox.js b/core/field_checkbox.js index f82a718c2..070454bb7 100644 --- a/core/field_checkbox.js +++ b/core/field_checkbox.js @@ -218,6 +218,8 @@ Blockly.FieldCheckbox.prototype.convertValueToBool_ = function(value) { */ Blockly.FieldCheckbox.prototype.getCorrectedSize = function() { this.getSize(); + + // TODO (#2562): Remove getCorrectedSize. return new goog.math.Size(this.size_.width + Blockly.BlockSvg.SEP_SPACE_X, Blockly.Field.BORDER_RECT_DEFAULT_HEIGHT); }; diff --git a/core/field_colour.js b/core/field_colour.js index 7835822be..e9f7ca639 100644 --- a/core/field_colour.js +++ b/core/field_colour.js @@ -351,6 +351,7 @@ Blockly.FieldColour.prototype.getCorrectedSize = function() { // getSize also renders and updates the size if needed. Rather than duplicate // 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, Blockly.Field.BORDER_RECT_DEFAULT_HEIGHT - 1); diff --git a/core/field_dropdown.js b/core/field_dropdown.js index 46144acc4..651c18952 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -556,6 +556,9 @@ Blockly.FieldDropdown.prototype.getCorrectedSize = function() { // getSize also renders and updates the size if needed. Rather than duplicate // the logic to figure out whether to rerender, just call getSize. this.getSize(); + // This extra 9 was probably to add padding between rows. + // It's also found in render_, renderSelectedImage_, and renderSelectedText_. + // TODO (#2562): Remove getCorrectedSize. return new goog.math.Size(this.size_.width + Blockly.BlockSvg.SEP_SPACE_X, this.size_.height - 9); }; diff --git a/core/field_image.js b/core/field_image.js index 615de00f3..6f329dafb 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -201,7 +201,7 @@ Blockly.FieldImage.prototype.getCorrectedSize = function() { // Old rendering adds an extra pixel under the image. We include this in the // height of the image in new rendering, rather than having the spacer below // know that there was an image in the previous row. - // TODO: Remove. + // TODO (#2562): Remove getCorrectedSize. return new goog.math.Size(this.size_.width, this.height_ + 1); }; diff --git a/core/field_label.js b/core/field_label.js index 6cab5af77..c1392d3cf 100644 --- a/core/field_label.js +++ b/core/field_label.js @@ -109,6 +109,9 @@ Blockly.FieldLabel.prototype.getCorrectedSize = function() { // getSize also renders and updates the size if needed. Rather than duplicate // the logic to figure out whether to rerender, just call getSize. this.getSize(); + // This extra 5 was probably to add padding between rows. + // It's also found in the constructor and in initView. + // TODO (#2562): Remove getCorrectedSize. return new goog.math.Size(this.size_.width, this.size_.height - 5); }; diff --git a/core/field_textinput.js b/core/field_textinput.js index f00ec6d01..39c3061e2 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -441,6 +441,7 @@ Blockly.FieldTextInput.prototype.getCorrectedSize = function() { // getSize also renders and updates the size if needed. Rather than duplicate // 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); };