Skip to content

Commit b7bca5f

Browse files
authored
field_expandable_add.js -- fix centering
1 parent f1c8814 commit b7bca5f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/field_expandable_add.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Blockly.FieldExpandableAdd.prototype.init = function() {
7272
}
7373
Blockly.FieldExpandableAdd.superClass_.init.call(this);
7474

75+
const ratio = Blockly.BlockSvg.FIELD_HEIGHT / 32;
7576
this.size_.width = Blockly.BlockSvg.FIELD_HEIGHT;
7677
this.overrideSep = 1;
7778
this.boxGroup_ = Blockly.utils.createSvgElement('g', {}, null);
@@ -93,8 +94,8 @@ Blockly.FieldExpandableAdd.prototype.init = function() {
9394
{
9495
'x': 5,
9596
'y': 5,
96-
'width': this.size_.width / 1.5,
97-
'height': this.size_.height / 1.5,
97+
'width': (this.size_.width / 1.5) * ratio,
98+
'height': (this.size_.height / 1.5) * ratio,
9899
'xlink:href': plusIcon,
99100
'href': plusIcon,
100101
},

0 commit comments

Comments
 (0)