From 49cfa0efd7cfca0a469f41a780708fc9420c3752 Mon Sep 17 00:00:00 2001 From: jwklong Date: Sat, 16 Nov 2024 11:40:31 +0000 Subject: [PATCH] a --- core/block_render.js | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/core/block_render.js b/core/block_render.js index e41806ca4d..e60e4947e8 100644 --- a/core/block_render.js +++ b/core/block_render.js @@ -260,15 +260,17 @@ Blockly.BlockSvg.INNER_BOTTOM_LEFT_CORNER = * @const */ Blockly.BlockSvg.INPUT_SHAPE_LEAF = - `M ${4 * Blockly.BlockSvg.GRID_UNIT} 0 ` + - `a ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} ` + - `l 0 ${2.4 * Blockly.BlockSvg.GRID_UNIT} ` + - `a ${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 -${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} ` + - `h ${4 * Blockly.BlockSvg.GRID_UNIT} ` + - `a ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 -${4 * Blockly.BlockSvg.GRID_UNIT} -${4 * Blockly.BlockSvg.GRID_UNIT} ` + - `l 0 -${2.4 * Blockly.BlockSvg.GRID_UNIT} ` + - `a ${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 ${1.6 * Blockly.BlockSvg.GRID_UNIT} -${1.6 * Blockly.BlockSvg.GRID_UNIT} ` + - `z` + ` + M ${4 * Blockly.BlockSvg.GRID_UNIT} 0 + a ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} + l 0 ${2.4 * Blockly.BlockSvg.GRID_UNIT} + a ${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 -${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} + h -${4 * Blockly.BlockSvg.GRID_UNIT} + a ${4 * Blockly.BlockSvg.GRID_UNIT} ${4 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 -${4 * Blockly.BlockSvg.GRID_UNIT} -${4 * Blockly.BlockSvg.GRID_UNIT} + l 0 -${2.4 * Blockly.BlockSvg.GRID_UNIT} + a ${1.6 * Blockly.BlockSvg.GRID_UNIT} ${1.6 * Blockly.BlockSvg.GRID_UNIT} 0 0 1 ${1.6 * Blockly.BlockSvg.GRID_UNIT} -${1.6 * Blockly.BlockSvg.GRID_UNIT} + z + ` /** * Width of empty plus input shape. @@ -1570,8 +1572,10 @@ Blockly.BlockSvg.prototype.renderDrawLeft_ = function(steps) { } else if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_PLUS) { // Draw a half-plus. let unit = 6 - let remainingHeight = this.edgeShapeWidth_ * 2 - unit * 6 + let remainingHeight = this.edgeShapeWidth_ * 2 - 36 + let remainingWidth = this.edgeShapeWidth_ - 40 steps.push( + `l -${remainingWidth} 0 ` + `a ${unit} ${unit} 0 0 1 -${unit} -${unit} ` + `a ${unit} ${unit} 0 0 0 -${unit} -${unit} ` + `l -2 0 ` + @@ -1580,7 +1584,8 @@ Blockly.BlockSvg.prototype.renderDrawLeft_ = function(steps) { `a ${unit} ${unit} 0 0 1 ${unit} -${unit} ` + `l 2 0 ` + `a ${unit} ${unit} 0 0 0 ${unit} -${unit} ` + - `a ${unit} ${unit} 0 0 1 ${unit} -${unit}` + `a ${unit} ${unit} 0 0 1 ${unit} -${unit} ` + + `l ${remainingWidth} 0` ) } } @@ -1614,8 +1619,10 @@ Blockly.BlockSvg.prototype.drawEdgeShapeRight_ = function(steps) { } else if (this.edgeShape_ === Blockly.OUTPUT_SHAPE_PLUS) { // Draw a half-plus. let unit = 6 - let remainingHeight = this.edgeShapeWidth_ * 2 - unit * 6 + let remainingHeight = this.edgeShapeWidth_ * 2 - 36 + let remainingWidth = this.edgeShapeWidth_ - 40 steps.push( + `l ${remainingWidth} 0 ` + `a ${unit} ${unit} 0 0 1 ${unit} ${unit} ` + `a ${unit} ${unit} 0 0 0 ${unit} ${unit} ` + `l 2 0 ` + @@ -1624,7 +1631,8 @@ Blockly.BlockSvg.prototype.drawEdgeShapeRight_ = function(steps) { `a ${unit} ${unit} 0 0 1 -${unit} ${unit} ` + `l -2 0 ` + `a ${unit} ${unit} 0 0 0 -${unit} ${unit} ` + - `a ${unit} ${unit} 0 0 1 -${unit} ${unit}` + `a ${unit} ${unit} 0 0 1 -${unit} ${unit} ` + + `l -${remainingWidth} 0` ) } }