From 835a6120a2cf7a9dfd636c14b3805167e222b4f3 Mon Sep 17 00:00:00 2001 From: Monica Kozbial Date: Mon, 6 Jan 2020 16:34:51 -0800 Subject: [PATCH] Removing leftover constant MIN_BLOCK_Y in BlockSvg. (#3552) --- core/block_svg.js | 8 -------- core/bubble.js | 7 +++++-- core/workspace_svg.js | 3 ++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/core/block_svg.js b/core/block_svg.js index 571b7b8e9..e5c55a457 100644 --- a/core/block_svg.js +++ b/core/block_svg.js @@ -158,14 +158,6 @@ Blockly.BlockSvg.COLLAPSED_WARNING_ID = 'TEMP_COLLAPSED_WARNING_'; // Leftover UI constants from block_render_svg.js. -/** - * Minimum height of a block. - * @const - * @package - */ -// TODO (#3142): Remove. -Blockly.BlockSvg.MIN_BLOCK_Y = 25; - /** * Do blocks with no previous or output connections have a 'hat' on top? * @const diff --git a/core/bubble.js b/core/bubble.js index 883614e77..f66982b07 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -452,8 +452,11 @@ Blockly.Bubble.prototype.layoutBubble_ = function() { var optimalTop = this.getOptimalRelativeTop_(metrics); var bbox = this.shape_.getBBox(); - var topPosition = {x: optimalLeft, - y: -this.height_ - Blockly.BlockSvg.MIN_BLOCK_Y}; + var topPosition = { + x: optimalLeft, + y: -this.height_ - + this.workspace_.getRenderer().getConstants().MIN_BLOCK_HEIGHT + }; var startPosition = {x: -this.width_ - 30, y: optimalTop}; var endPosition = {x: bbox.width, y: optimalTop}; var bottomPosition = {x: optimalLeft, y: bbox.height}; diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 2b62fb62f..900e817f1 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1655,7 +1655,8 @@ Blockly.WorkspaceSvg.prototype.cleanUp = function() { block.moveBy(-xy.x, cursorY - xy.y); block.snapToGrid(); cursorY = block.getRelativeToSurfaceXY().y + - block.getHeightWidth().height + Blockly.BlockSvg.MIN_BLOCK_Y; + block.getHeightWidth().height + + this.renderer_.getConstants().MIN_BLOCK_HEIGHT; } Blockly.Events.setGroup(false); this.setResizesEnabled(true);