mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Merge pull request #2971 from rachel-fenichel/dark_path
Remove references to dark path offset; fix highlights while dragging
This commit is contained in:
@@ -216,14 +216,14 @@ Blockly.RenderedConnection.prototype.highlight = function() {
|
||||
var yLen = 5;
|
||||
steps = Blockly.utils.svgPaths.moveBy(0, -yLen) +
|
||||
Blockly.utils.svgPaths.lineOnAxis('v', yLen) +
|
||||
Blockly.blockRendering.constants.PUZZLE_TAB.pathDown +
|
||||
Blockly.blockRendering.getConstants().PUZZLE_TAB.pathDown +
|
||||
Blockly.utils.svgPaths.lineOnAxis('v', yLen);
|
||||
} else {
|
||||
var xLen = 5;
|
||||
// Horizontal line, notch, horizontal line.
|
||||
steps = Blockly.utils.svgPaths.moveBy(-xLen, 0) +
|
||||
Blockly.utils.svgPaths.lineOnAxis('h', xLen) +
|
||||
Blockly.blockRendering.constants.NOTCH.pathLeft +
|
||||
Blockly.blockRendering.getConstants().NOTCH.pathLeft +
|
||||
Blockly.utils.svgPaths.lineOnAxis('h', xLen);
|
||||
}
|
||||
var xy = this.sourceBlock_.getRelativeToSurfaceXY();
|
||||
|
||||
@@ -190,28 +190,15 @@ Blockly.thrasos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
|
||||
return this.constants_.NO_PADDING;
|
||||
}
|
||||
// Spacing between a square corner and a previous or next connection
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next)) {
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next) ||
|
||||
Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
return next.notchOffset;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
// Next connections are shifted slightly to the left (in both LTR and RTL)
|
||||
// to make the dark path under the previous connection show through.
|
||||
var offset = (this.RTL ? 1 : -1) *
|
||||
this.constants_.DARK_PATH_OFFSET / 2;
|
||||
return next.notchOffset + offset;
|
||||
}
|
||||
}
|
||||
|
||||
// Spacing between a rounded corner and a previous or next connection.
|
||||
if (Blockly.blockRendering.Types.isLeftRoundedCorner(prev) && next) {
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next)) {
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
// Next connections are shifted slightly to the left (in both LTR and RTL)
|
||||
// to make the dark path under the previous connection show through.
|
||||
var offset = (this.RTL ? 1 : -1) *
|
||||
this.constants_.DARK_PATH_OFFSET / 2;
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS + offset;
|
||||
}
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS;
|
||||
}
|
||||
|
||||
// Spacing between two fields of the same editability.
|
||||
|
||||
@@ -194,27 +194,17 @@ Blockly.zelos.RenderInfo.prototype.getInRowSpacing_ = function(prev, next) {
|
||||
return this.constants_.NO_PADDING;
|
||||
}
|
||||
// Spacing between a square corner and a previous or next connection
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next)) {
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next) ||
|
||||
Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
return next.notchOffset;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
// Next connections are shifted slightly to the left (in both LTR and RTL)
|
||||
// to make the dark path under the previous connection show through.
|
||||
var offset = (this.RTL ? 1 : -1) *
|
||||
this.constants_.DARK_PATH_OFFSET / 2;
|
||||
return next.notchOffset + offset;
|
||||
}
|
||||
}
|
||||
|
||||
// Spacing between a rounded corner and a previous or next connection.
|
||||
if (Blockly.blockRendering.Types.isLeftRoundedCorner(prev) && next) {
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next)) {
|
||||
if (Blockly.blockRendering.Types.isPreviousConnection(next) ||
|
||||
Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS;
|
||||
} else if (Blockly.blockRendering.Types.isNextConnection(next)) {
|
||||
// Next connections are shifted slightly to the left (in both LTR and RTL)
|
||||
// to make the dark path under the previous connection show through.
|
||||
var offset = (this.RTL ? 1 : -1) *
|
||||
this.constants_.DARK_PATH_OFFSET / 2;
|
||||
return next.notchOffset - this.constants_.CORNER_RADIUS + offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user