Update positionable jsdoc (#4908)

This commit is contained in:
Monica Kozbial
2021-06-14 13:14:01 -07:00
committed by GitHub
parent 1931c31aa6
commit ff34e067f8
4 changed files with 10 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ Blockly.IPositionable.prototype.position;
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {!Blockly.utils.Rect} The UI elementss bounding box.
* @return {?Blockly.utils.Rect} The UI elementss bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
Blockly.IPositionable.prototype.getBoundingRectangle;

View File

@@ -506,7 +506,8 @@ Blockly.Trashcan.prototype.position = function(metrics, savedPositions) {
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {!Blockly.utils.Rect} The UI elementss bounding box.
* @return {?Blockly.utils.Rect} The UI elementss bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
Blockly.Trashcan.prototype.getBoundingRectangle = function() {
var bottom = this.top_ + this.BODY_HEIGHT_ + this.LID_HEIGHT_;

View File

@@ -1148,7 +1148,10 @@ Blockly.WorkspaceSvg.prototype.resize = function() {
var savedPositions = [];
for (var i = 0, positionable; (positionable = positionables[i]); i++) {
positionable.position(metrics, savedPositions);
savedPositions.push(positionable.getBoundingRectangle());
var boundingRect = positionable.getBoundingRectangle();
if (boundingRect) {
savedPositions.push(boundingRect);
}
}
if (this.scrollbar) {

View File

@@ -228,7 +228,8 @@ Blockly.ZoomControls.prototype.dispose = function() {
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {!Blockly.utils.Rect} The UI elementss bounding box.
* @return {?Blockly.utils.Rect} The UI elementss bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
Blockly.ZoomControls.prototype.getBoundingRectangle = function() {
var height = this.SMALL_SPACING_ + 2 * this.HEIGHT_;