mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
Fix scrolled text input widgetdiv positioning. (#3533)
* Fix scrolled text input widgetdiv positioning. * Fix dropdown div bounds element when scrolled.
This commit is contained in:
@@ -377,16 +377,16 @@ Blockly.DropDownDiv.show = function(owner, rtl, primaryX, primaryY,
|
||||
* @private
|
||||
*/
|
||||
Blockly.DropDownDiv.getBoundsInfo_ = function() {
|
||||
var boundPosition = Blockly.DropDownDiv.boundsElement_
|
||||
.getBoundingClientRect();
|
||||
var boundPosition = Blockly.utils.style.getPageOffset(
|
||||
/** @type {!Element} */ (Blockly.DropDownDiv.boundsElement_));
|
||||
var boundSize = Blockly.utils.style.getSize(
|
||||
Blockly.DropDownDiv.boundsElement_);
|
||||
/** @type {!Element} */ (Blockly.DropDownDiv.boundsElement_));
|
||||
|
||||
return {
|
||||
left: boundPosition.left,
|
||||
right: boundPosition.left + boundSize.width,
|
||||
top: boundPosition.top,
|
||||
bottom: boundPosition.top + boundSize.height,
|
||||
left: boundPosition.x,
|
||||
right: boundPosition.x + boundSize.width,
|
||||
top: boundPosition.y,
|
||||
bottom: boundPosition.y + boundSize.height,
|
||||
width: boundSize.width,
|
||||
height: boundSize.height
|
||||
};
|
||||
|
||||
@@ -698,9 +698,10 @@ Blockly.Field.prototype.getScaledBBox = function() {
|
||||
scaledHeight += 1 * scale;
|
||||
}
|
||||
} else {
|
||||
var xy = this.borderRect_.getBoundingClientRect();
|
||||
var scaledWidth = xy.width;
|
||||
var scaledHeight = xy.height;
|
||||
var bBox = this.borderRect_.getBoundingClientRect();
|
||||
var xy = Blockly.utils.style.getPageOffset(this.borderRect_);
|
||||
var scaledWidth = bBox.width;
|
||||
var scaledHeight = bBox.height;
|
||||
}
|
||||
return {
|
||||
top: xy.y,
|
||||
|
||||
Reference in New Issue
Block a user