From 2d314cbd4a6a1db5eb014883f5ace352c0f60b9e Mon Sep 17 00:00:00 2001 From: kozbial Date: Mon, 19 Aug 2019 11:11:45 -0700 Subject: [PATCH] Reverting highlight methods restructure. --- .../block_render_draw_highlight.js | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) 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 46fffc8a2..bf397a8f9 100644 --- a/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js +++ b/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js @@ -115,35 +115,39 @@ Blockly.blockRendering.Highlighter.prototype.drawJaggedEdge_ = function(row) { Blockly.blockRendering.Highlighter.prototype.drawValueInput = function(row) { var input = row.getLastInput(); + var steps = ''; if (this.RTL_) { var belowTabHeight = row.height - input.connectionHeight; - this.steps_.push(Blockly.utils.svgPaths.moveTo( - input.xPos + input.width - this.highlightOffset_, row.yPos)); - this.steps_.push(this.puzzleTabPaths_.pathDown(this.RTL_)); - this.steps_.push( - Blockly.utils.svgPaths.lineOnAxis('v', belowTabHeight)); + steps = + Blockly.utils.svgPaths.moveTo( + input.xPos + input.width - this.highlightOffset_, row.yPos) + + this.puzzleTabPaths_.pathDown(this.RTL_) + + Blockly.utils.svgPaths.lineOnAxis('v', belowTabHeight); } else { - this.steps_.push( - Blockly.utils.svgPaths.moveTo(input.xPos + input.width, row.yPos)); - this.steps_.push(this.puzzleTabPaths_.pathDown(this.RTL_)); + steps = + Blockly.utils.svgPaths.moveTo(input.xPos + input.width, row.yPos) + + this.puzzleTabPaths_.pathDown(this.RTL_); } + + this.steps_.push(steps); }; Blockly.blockRendering.Highlighter.prototype.drawStatementInput = function(row) { - var input = row.getLastInput(); + var steps = ''; if (this.RTL_) { var innerHeight = row.height - (2 * this.insideCornerPaths_.height); - this.steps_.push(Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos)); - this.steps_.push(this.insideCornerPaths_.pathTop(this.RTL_)); - this.steps_.push( - Blockly.utils.svgPaths.lineOnAxis('v', innerHeight)); - this.steps_.push(this.insideCornerPaths_.pathBottom(this.RTL_)); + steps = + Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos) + + this.insideCornerPaths_.pathTop(this.RTL_) + + Blockly.utils.svgPaths.lineOnAxis('v', innerHeight) + + this.insideCornerPaths_.pathBottom(this.RTL_); } else { - this.steps_.push( + steps = Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos + row.height) + - this.insideCornerPaths_.pathBottom(this.RTL_)); + this.insideCornerPaths_.pathBottom(this.RTL_); } + this.steps_.push(steps); }; Blockly.blockRendering.Highlighter.prototype.drawRightSideRow = function(row) {