Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
jwklong committed Nov 16, 2024
1 parent 567e8fc commit 49cfa0e
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions core/block_render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ` +
Expand All @@ -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`
)
}
}
Expand Down Expand Up @@ -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 ` +
Expand All @@ -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`
)
}
}
Expand Down

0 comments on commit 49cfa0e

Please sign in to comment.