diff --git a/core/renderers/block_rendering_rewrite/block_render_draw.js b/core/renderers/block_rendering_rewrite/block_render_draw.js index f229717d5..7e784124b 100644 --- a/core/renderers/block_rendering_rewrite/block_render_draw.js +++ b/core/renderers/block_rendering_rewrite/block_render_draw.js @@ -191,7 +191,7 @@ Blockly.blockRendering.Drawer.prototype.drawValueInput_ = function(row) { this.positionExternalValueConnection_(row); this.outlinePath_ += - Blockly.utils.svgPaths.lineOnAxis('H', row.xPos + row.width) + + Blockly.utils.svgPaths.lineOnAxis('H', input.xPos + input.width) + input.connectionShape.pathDown + Blockly.utils.svgPaths.lineOnAxis('v', row.height - input.connectionHeight); }; @@ -212,15 +212,18 @@ Blockly.blockRendering.Drawer.prototype.drawStatementInput_ = function(row) { var x = input.xPos + input.width; var innerTopLeftCorner = - Blockly.blockRendering.constants.NOTCH.pathRight + ' h -' + - (Blockly.blockRendering.constants.NOTCH_WIDTH - - Blockly.blockRendering.constants.CORNER_RADIUS) + + input.notchShape.pathRight + + Blockly.utils.svgPaths.lineOnAxis('h', + -(Blockly.blockRendering.constants.NOTCH_OFFSET_LEFT - + Blockly.blockRendering.constants.INSIDE_CORNERS.width)) + Blockly.blockRendering.constants.INSIDE_CORNERS.pathTop; + var innerHeight = + row.height -(2 * Blockly.blockRendering.constants.INSIDE_CORNERS.height); + this.outlinePath_ += Blockly.utils.svgPaths.lineOnAxis('H', x) + innerTopLeftCorner + - Blockly.utils.svgPaths.lineOnAxis('v', - row.height - (2 * Blockly.blockRendering.constants.INSIDE_CORNERS.height)) + + Blockly.utils.svgPaths.lineOnAxis('v', innerHeight) + Blockly.blockRendering.constants.INSIDE_CORNERS.pathBottom; this.positionStatementInputConnection_(row); 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 413eae58f..46fffc8a2 100644 --- a/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js +++ b/core/renderers/block_rendering_rewrite/block_render_draw_highlight.js @@ -115,40 +115,35 @@ 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; - steps = - Blockly.utils.svgPaths.moveTo( - row.xPos + row.width - this.highlightOffset_, row.yPos) + - this.puzzleTabPaths_.pathDown(this.RTL_) + - Blockly.utils.svgPaths.lineOnAxis('v', belowTabHeight); + 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)); } else { - steps = - Blockly.utils.svgPaths.moveTo(row.xPos + row.width, row.yPos) + - this.puzzleTabPaths_.pathDown(this.RTL_); + this.steps_.push( + Blockly.utils.svgPaths.moveTo(input.xPos + input.width, row.yPos)); + this.steps_.push(this.puzzleTabPaths_.pathDown(this.RTL_)); } - - this.steps_.push(steps); }; Blockly.blockRendering.Highlighter.prototype.drawStatementInput = function(row) { - var steps = ''; - var statementEdge = row.xPos + row.statementEdge; + var input = row.getLastInput(); if (this.RTL_) { var innerHeight = row.height - (2 * this.insideCornerPaths_.height); - steps = - Blockly.utils.svgPaths.moveTo(statementEdge, row.yPos) + - this.insideCornerPaths_.pathTop(this.RTL_) + - Blockly.utils.svgPaths.lineOnAxis('v', innerHeight) + - this.insideCornerPaths_.pathBottom(this.RTL_); + 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_)); } else { - steps = - Blockly.utils.svgPaths.moveTo(statementEdge, row.yPos + row.height) + - this.insideCornerPaths_.pathBottom(this.RTL_); + this.steps_.push( + Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos + row.height) + + this.insideCornerPaths_.pathBottom(this.RTL_)); } - this.steps_.push(steps); }; Blockly.blockRendering.Highlighter.prototype.drawRightSideRow = function(row) { diff --git a/core/renderers/block_rendering_rewrite/block_rendering_constants.js b/core/renderers/block_rendering_rewrite/block_rendering_constants.js index 76a5e3072..f39b06718 100644 --- a/core/renderers/block_rendering_rewrite/block_rendering_constants.js +++ b/core/renderers/block_rendering_rewrite/block_rendering_constants.js @@ -289,6 +289,7 @@ Blockly.blockRendering.constants.INSIDE_CORNERS = (function() { Blockly.utils.svgPaths.point(radius, radius)); return { + width: radius, height: radius, pathTop: innerTopLeftCorner, pathBottom: innerBottomLeftCorner