diff --git a/core/renderers/common/drawer.js b/core/renderers/common/drawer.js index cb29e828b..1f8646ef0 100644 --- a/core/renderers/common/drawer.js +++ b/core/renderers/common/drawer.js @@ -92,10 +92,8 @@ Blockly.blockRendering.Drawer.prototype.draw = function() { Blockly.blockRendering.Drawer.prototype.recordSizeOnBlock_ = function() { // This is used when the block is reporting its size to anyone else. // The dark path adds to the size of the block in both X and Y. - this.block_.height = this.info_.height + - this.constants_.DARK_PATH_OFFSET; - this.block_.width = this.info_.widthWithChildren + - this.constants_.DARK_PATH_OFFSET; + this.block_.height = this.info_.height; + this.block_.width = this.info_.widthWithChildren; }; /** diff --git a/core/renderers/geras/drawer.js b/core/renderers/geras/drawer.js index d3221e764..01a8af4d0 100644 --- a/core/renderers/geras/drawer.js +++ b/core/renderers/geras/drawer.js @@ -70,18 +70,6 @@ Blockly.geras.Drawer.prototype.draw = function() { this.recordSizeOnBlock_(); }; -/** - * @override - */ -Blockly.geras.Drawer.prototype.recordSizeOnBlock_ = function() { - // This is used when the block is reporting its size to anyone else. - // The dark path adds to the size of the block in both X and Y. - this.block_.height = this.info_.height + - this.constants_.DARK_PATH_OFFSET; - this.block_.width = this.info_.widthWithChildren + - this.constants_.DARK_PATH_OFFSET; -}; - /** * @override */ diff --git a/core/renderers/geras/highlighter.js b/core/renderers/geras/highlighter.js index 3b00dad1c..cd54857c5 100644 --- a/core/renderers/geras/highlighter.js +++ b/core/renderers/geras/highlighter.js @@ -211,7 +211,7 @@ Blockly.geras.Highlighter.prototype.drawLeft = function() { this.steps_ += Blockly.utils.svgPaths.moveTo(this.info_.startX, tabBottom); } else { var left = this.info_.startX + this.highlightOffset_; - var bottom = this.info_.height - this.highlightOffset_; + var bottom = this.info_.bottomRow.baseline - this.highlightOffset_; this.steps_ += Blockly.utils.svgPaths.moveTo(left, bottom); this.steps_ += Blockly.utils.svgPaths.lineOnAxis('V', tabBottom); } diff --git a/core/renderers/geras/info.js b/core/renderers/geras/info.js index 2deb28a0d..d78400c0d 100644 --- a/core/renderers/geras/info.js +++ b/core/renderers/geras/info.js @@ -359,8 +359,10 @@ Blockly.geras.RenderInfo.prototype.finalize_ = function() { } this.bottomRow.baseline = yCursor - this.bottomRow.descenderHeight; - this.widthWithChildren = widestRowWithConnectedBlocks + this.startX; - - this.height = yCursor; + // The dark (lowlight) adds to the size of the block in both x and y. + this.widthWithChildren = widestRowWithConnectedBlocks + + this.startX + this.constants_.DARK_PATH_OFFSET; + this.width += this.constants_.DARK_PATH_OFFSET; + this.height = yCursor + this.constants_.DARK_PATH_OFFSET; this.startY = this.topRow.capline; };