From 055c11155d3c7341ed3a941a311edf1997a5a6d8 Mon Sep 17 00:00:00 2001 From: carlosperate Date: Fri, 21 Aug 2015 18:51:25 +0100 Subject: [PATCH 1/2] Update getScaledBBox_ to return new object to fix issue in IE. --- core/field.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/field.js b/core/field.js index 279d19539..67a5c64ba 100644 --- a/core/field.js +++ b/core/field.js @@ -231,9 +231,9 @@ Blockly.Field.prototype.getSize = function() { */ Blockly.Field.prototype.getScaledBBox_ = function() { var bBox = this.borderRect_.getBBox(); - bBox.width *= this.sourceBlock_.workspace.scale; - bBox.height *= this.sourceBlock_.workspace.scale; - return bBox; + // Create new object, as getBBox can return an uneditable SVGRect. + return {width: bBox.width * this.sourceBlock_.workspace.scale, + height: bBox.height * this.sourceBlock_.workspace.scale}; }; /** From 17be3219ee37867267fd6eec797e5aeb577a8c90 Mon Sep 17 00:00:00 2001 From: carlosperate Date: Fri, 21 Aug 2015 19:20:00 +0100 Subject: [PATCH 2/2] Update FieldTextInput to not edit possible read-only attributes. The SVGRect returned from getBBox can be have its attributes as read-only. --- core/field_textinput.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/field_textinput.js b/core/field_textinput.js index 3fdbacd0f..58db44915 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -228,10 +228,8 @@ Blockly.FieldTextInput.prototype.validate_ = function() { Blockly.FieldTextInput.prototype.resizeEditor_ = function() { var div = Blockly.WidgetDiv.DIV; var bBox = this.fieldGroup_.getBBox(); - bBox.width *= this.sourceBlock_.workspace.scale; - bBox.height *= this.sourceBlock_.workspace.scale; - div.style.width = bBox.width + 'px'; - div.style.height = bBox.height + 'px'; + div.style.width = bBox.width * this.sourceBlock_.workspace.scale + 'px'; + div.style.height = bBox.height * this.sourceBlock_.workspace.scale + 'px'; var xy = this.getAbsoluteXY_(); // In RTL mode block fields and LTR input fields the left edge moves, // whereas the right edge is fixed. Reposition the editor.