More corner work

This commit is contained in:
Rachel Fenichel
2019-07-26 16:10:03 -07:00
parent b54ec1e2db
commit dbea4615e8
2 changed files with 4 additions and 17 deletions

View File

@@ -64,9 +64,6 @@ Blockly.blockRendering.Highlighter.prototype.drawTopCorner = function(row) {
this.highlightSteps_.push(
Blockly.blockRendering.constants.OUTSIDE_CORNER_HIGHLIGHTS.topLeftStart(
this.info_.RTL));
// this.highlightSteps_.push(this.info_.RTL ?
// Blockly.blockRendering.constants.TOP_LEFT_CORNER_START_HIGHLIGHT_RTL :
// Blockly.blockRendering.constants.TOP_LEFT_CORNER_START_HIGHLIGHT_LTR);
this.highlightSteps_.push(
Blockly.blockRendering.constants.OUTSIDE_CORNER_HIGHLIGHTS.topLeft);
} else if (elem.type === 'previous connection') {

View File

@@ -358,14 +358,6 @@ Blockly.blockRendering.constants.INSIDE_CORNER_HIGHLIGHTS = (function() {
*/
var distance45outside = (1 - Math.SQRT1_2) * (radius + offset) - offset;
/**
* Distance from shape edge to intersect with a curved corner at 45 degrees.
* Applies to highlighting on around the inside of a curve.
* @const
*/
var distance45inside = (1 - Math.SQRT1_2) * (radius - offset) + offset;
var pathTopRtl = Blockly.utils.svgPaths.arc('a', '0 0,0', radius,
Blockly.utils.svgPaths.point(
-distance45outside - offset,
@@ -427,24 +419,22 @@ Blockly.blockRendering.constants.OUTSIDE_CORNER_HIGHLIGHTS = (function() {
* @const
*/
var topLeftCornerStartRtl =
'm ' + distance45inside + ',' +
distance45inside;
Blockly.utils.svgPaths.moveBy(distance45inside, distance45inside);
/**
* SVG start point for drawing the top-left corner's highlight in LTR.
* @const
*/
var topLeftCornerStartLtr =
'm 0.5,' + (radius - offset);
Blockly.utils.svgPaths.moveBy(offset, radius - offset);
/**
* SVG path for drawing the highlight on the rounded top-left corner.
* @const
*/
var topLeftCornerHighlight =
'A ' + (radius - offset) + ',' +
(radius - offset) + ' 0 0,1 ' +
radius + ',0.5';
Blockly.utils.svgPaths.arc('A', '0 0,1', radius - offset,
Blockly.utils.svgPaths.point(radius, offset));
var bottomLeftCornerStart =