mirror of
https://github.com/google/blockly.git
synced 2026-01-29 19:50:10 +01:00
Fix FF editor location by a pixel.
This commit is contained in:
@@ -227,13 +227,13 @@ Blockly.Field.prototype.getSize = function() {
|
||||
/**
|
||||
* Returns the height and width of the field,
|
||||
* accounting for the workspace scaling.
|
||||
* @return {!Object} Height and width.
|
||||
* @return {!goog.math.Size} Height and width.
|
||||
*/
|
||||
Blockly.Field.prototype.getScaledBBox_ = function() {
|
||||
var bBox = this.borderRect_.getBBox();
|
||||
// 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};
|
||||
// Create new object, as getBBox can return an uneditable SVGRect in IE.
|
||||
return new goog.math.Size(bBox.width * this.sourceBlock_.workspace.scale,
|
||||
bBox.height * this.sourceBlock_.workspace.scale);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -240,6 +240,12 @@ Blockly.FieldTextInput.prototype.resizeEditor_ = function() {
|
||||
}
|
||||
// Shift by a few pixels to line up exactly.
|
||||
xy.y += 1;
|
||||
if (goog.userAgent.GECKO && Blockly.WidgetDiv.DIV.style.top) {
|
||||
// Firefox mis-reports the location of the border by a pixel
|
||||
// once the WidgetDiv is moved into position.
|
||||
xy.x -= 1;
|
||||
xy.y -= 1;
|
||||
}
|
||||
if (goog.userAgent.WEBKIT) {
|
||||
xy.y -= 3;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,8 @@ Blockly.WidgetDiv.show = function(newOwner, rtl, dispose) {
|
||||
Blockly.WidgetDiv.hide = function() {
|
||||
if (Blockly.WidgetDiv.owner_) {
|
||||
Blockly.WidgetDiv.DIV.style.display = 'none';
|
||||
Blockly.WidgetDiv.DIV.style.left = '';
|
||||
Blockly.WidgetDiv.DIV.style.top = '';
|
||||
Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_();
|
||||
Blockly.WidgetDiv.owner_ = null;
|
||||
Blockly.WidgetDiv.dispose_ = null;
|
||||
|
||||
Reference in New Issue
Block a user