mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Fix slight offset in statement input connection X location. (#2953)
* Fix slight offset in statement input connection X location.
This commit is contained in:
@@ -394,8 +394,9 @@ Blockly.blockRendering.Drawer.prototype.positionStatementInputConnection_ = func
|
||||
var connX = row.xPos + row.statementEdge + input.notchOffset;
|
||||
if (this.info_.RTL) {
|
||||
connX *= -1;
|
||||
} else {
|
||||
connX += this.constants_.DARK_PATH_OFFSET;
|
||||
}
|
||||
connX += 0.5;
|
||||
input.connection.setOffsetInBlock(connX,
|
||||
row.yPos + this.constants_.DARK_PATH_OFFSET);
|
||||
}
|
||||
@@ -443,7 +444,8 @@ Blockly.blockRendering.Drawer.prototype.positionNextConnection_ = function() {
|
||||
if (bottomRow.connection) {
|
||||
var connInfo = bottomRow.connection;
|
||||
var x = connInfo.xPos; // Already contains info about startX
|
||||
var connX = (this.info_.RTL ? -x : x) + 0.5;
|
||||
var connX = (this.info_.RTL ? -x : x) +
|
||||
(this.constants_.DARK_PATH_OFFSET / 2);
|
||||
connInfo.connectionModel.setOffsetInBlock(
|
||||
connX, (connInfo.centerline - connInfo.height / 2) +
|
||||
this.constants_.DARK_PATH_OFFSET);
|
||||
|
||||
@@ -134,6 +134,7 @@ Blockly.geras.HighlightConstantProvider.prototype.makeInsideCorner = function()
|
||||
distance45outside + offset));
|
||||
|
||||
return {
|
||||
width: radius + offset,
|
||||
height: radius,
|
||||
pathTop: function(rtl) {
|
||||
return rtl ? pathTopRtl : '';
|
||||
|
||||
@@ -144,11 +144,15 @@ Blockly.geras.Highlighter.prototype.drawStatementInput = function(row) {
|
||||
Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos) +
|
||||
this.insideCornerPaths_.pathTop(this.RTL_) +
|
||||
Blockly.utils.svgPaths.lineOnAxis('v', innerHeight) +
|
||||
this.insideCornerPaths_.pathBottom(this.RTL_);
|
||||
this.insideCornerPaths_.pathBottom(this.RTL_) +
|
||||
Blockly.utils.svgPaths.lineTo(
|
||||
row.width - input.xPos - this.insideCornerPaths_.width, 0);
|
||||
} else {
|
||||
steps =
|
||||
Blockly.utils.svgPaths.moveTo(input.xPos, row.yPos + row.height) +
|
||||
this.insideCornerPaths_.pathBottom(this.RTL_);
|
||||
this.insideCornerPaths_.pathBottom(this.RTL_) +
|
||||
Blockly.utils.svgPaths.lineTo(
|
||||
row.width - input.xPos - this.insideCornerPaths_.width, 0);
|
||||
}
|
||||
this.steps_.push(steps);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user