Commit fe12aeee authored by Neil Fraser's avatar Neil Fraser

Merge pull request #164 from carlosperate/getScaledBBox_

Update getScaledBBox_ to return new object to fix issue in IE.
parents 73ad694b 17be3219
......@@ -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};
};
/**
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment