diff --git a/core/block_render_svg.js b/core/block_render_svg.js index 877760dfa..ace458096 100644 --- a/core/block_render_svg.js +++ b/core/block_render_svg.js @@ -88,13 +88,6 @@ Blockly.BlockSvg.TAB_WIDTH = 8; * @const */ Blockly.BlockSvg.START_HAT = false; -/** - * SVG path for drawing a horizontal puzzle tab from top to bottom. - * @const - */ -Blockly.BlockSvg.TAB_PATH_DOWN = 'v 5 c 0,10 -' + Blockly.BlockSvg.TAB_WIDTH + - ',-8 -' + Blockly.BlockSvg.TAB_WIDTH + ',7.5 s ' + - Blockly.BlockSvg.TAB_WIDTH + ',-2.5 ' + Blockly.BlockSvg.TAB_WIDTH + ',7.5'; /** * Returns a bounding box describing the dimensions of this block diff --git a/core/keyboard_nav/cursor_svg.js b/core/keyboard_nav/cursor_svg.js index 7214cd90d..0bb7a3904 100644 --- a/core/keyboard_nav/cursor_svg.js +++ b/core/keyboard_nav/cursor_svg.js @@ -191,6 +191,9 @@ Blockly.CursorSvg.prototype.showWithInputOutput_ = function() { var connection = /** @type {Blockly.Connection} */ (this.getCurNode().getLocation()); this.currentCursorSvg = this.cursorInputOutput_; + var path = Blockly.utils.svgPaths.moveTo(0,0) + + Blockly.blockRendering.constants.PUZZLE_TAB.pathDown; + this.cursorInputOutput_.setAttribute('d', path); this.setParent_(connection.getSourceBlock().getSvgRoot()); this.positionInputOutput_(connection); this.showCurrent_(); @@ -261,11 +264,6 @@ Blockly.CursorSvg.prototype.showWithStack_ = function() { var x = -1 * Blockly.CursorSvg.STACK_PADDING / 2; var y = -1 * Blockly.CursorSvg.STACK_PADDING / 2; - // If the block has an output connection it needs more padding. - if (block.outputConnection) { - x -= Blockly.BlockSvg.TAB_WIDTH; - } - this.currentCursorSvg = this.cursorSvgRect_; this.setParent_(block.getSvgRoot()); @@ -416,7 +414,6 @@ Blockly.CursorSvg.prototype.createCursorSvg_ = function() { { 'width': Blockly.CursorSvg.CURSOR_WIDTH, 'height': Blockly.CursorSvg.CURSOR_HEIGHT, - 'd': 'm 0,0 ' + Blockly.BlockSvg.TAB_PATH_DOWN + ' v 5', 'transform':'', 'style':'display: none;', 'fill': colour diff --git a/tests/rendering/svg_paths.html b/tests/rendering/svg_paths.html index 7e10c3bd7..6efe9a651 100644 --- a/tests/rendering/svg_paths.html +++ b/tests/rendering/svg_paths.html @@ -66,7 +66,6 @@ function addPathAt(path, x, y) { function start() { svgSpace = document.getElementById('workspace'); - addPathAt(Blockly.BlockSvg.TAB_PATH_DOWN, 0, 0); addPathAt(Blockly.BlockSvg.START_HAT_PATH, 0, 40); addPathAt(Blockly.BlockSvg.NOTCH_PATH_LEFT, 0, 60); addPathAt(Blockly.BlockSvg.NOTCH_PATH_RIGHT, 0, 70);