From 2e77f1903fa5e08ea6fd3d9e1188872a1b45c0aa Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 19 Aug 2019 13:21:23 -0700 Subject: [PATCH] Padding --- demos/custom-fields/field_turtle.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/custom-fields/field_turtle.js b/demos/custom-fields/field_turtle.js index fa98e7a56..1c53e5599 100644 --- a/demos/custom-fields/field_turtle.js +++ b/demos/custom-fields/field_turtle.js @@ -92,6 +92,8 @@ CustomFields.FieldTurtle.prototype.CURSOR = 'pointer'; // May change if the turtle gets fancy enough. CustomFields.FieldTurtle.prototype.TEXT_OFFSET_X = 80; +// Padding that the border rect adds around the turtle and its name. +CustomFields.FieldTurtle.prototype.PADDING = Blockly.Field.X_PADDING; // These are the different options for our turtle. Being declared this way // means they are static, and not translatable. If you want to do something @@ -320,8 +322,8 @@ CustomFields.FieldTurtle.prototype.renderEditor_ = function() { CustomFields.FieldTurtle.prototype.updateSize_ = function() { var size = this.movableGroup_.getBBox(); if (this.borderRect_) { - size.width += Blockly.Field.X_PADDING; - size.height += Blockly.Field.X_PADDING; + size.width += this.PADDING; + size.height += this.PADDING; this.borderRect_.setAttribute('width', size.width); this.borderRect_.setAttribute('height', size.height); }