Removing leftover constant MIN_BLOCK_Y in BlockSvg. (#3552)

This commit is contained in:
Monica Kozbial
2020-01-06 16:34:51 -08:00
committed by GitHub
parent c1ff28fcd2
commit 835a6120a2
3 changed files with 7 additions and 11 deletions

View File

@@ -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

View File

@@ -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};

View File

@@ -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);