Skip to content

Commit

Permalink
Update positionable jsdoc (#4908)
Browse files Browse the repository at this point in the history
  • Loading branch information
moniika authored Jun 14, 2021
1 parent 1931c31 commit ff34e06
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/interfaces/i_positionable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 elements’s bounding box.
* @return {?Blockly.utils.Rect} The UI elements’s bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
Blockly.IPositionable.prototype.getBoundingRectangle;
3 changes: 2 additions & 1 deletion core/trashcan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 elements’s bounding box.
* @return {?Blockly.utils.Rect} The UI elements’s 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_;
Expand Down
5 changes: 4 additions & 1 deletion core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion core/zoom_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 elements’s bounding box.
* @return {?Blockly.utils.Rect} The UI elements’s 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_;
Expand Down

0 comments on commit ff34e06

Please sign in to comment.