diff --git a/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js b/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js index e0e9f631b..32c7af293 100644 --- a/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js +++ b/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js @@ -92,7 +92,7 @@ Blockly.blockRendering.Highlighter.prototype.drawTopCorner = function(row) { } } - this.steps_.push('H', row.width - this.highlightOffset_); + this.steps_.push('H', this.info_.startX + row.width - this.highlightOffset_); }; Blockly.blockRendering.Highlighter.prototype.drawJaggedEdge_ = function(row) { diff --git a/core/renderers/block_rendering_rewrite/block_render_info.js b/core/renderers/block_rendering_rewrite/block_render_info.js index 59e0312c4..c04c9c640 100644 --- a/core/renderers/block_rendering_rewrite/block_render_info.js +++ b/core/renderers/block_rendering_rewrite/block_render_info.js @@ -695,10 +695,10 @@ Blockly.blockRendering.RenderInfo.prototype.finalize_ = function() { // Performance note: this could be combined with the draw pass, if the time // that this takes is excessive. But it shouldn't be, because it only // accesses and sets properties that already exist on the objects. - var yCursor = this.startY; + var yCursor = 0; for (var r = 0; r < this.rows.length; r++) { var row = this.rows[r]; - row.yPos = yCursor; + row.yPos = yCursor + this.startY; yCursor += row.height; // Add padding to the bottom row if block height is less than minimum if (row == this.bottomRow && @@ -721,5 +721,5 @@ Blockly.blockRendering.RenderInfo.prototype.finalize_ = function() { this.blockBottom = yCursor; // Don't count the start offset in the recorded height. - this.height = yCursor - this.startY; + this.height = yCursor; };