Skip to content
Snippets Groups Projects
Commit 06850512 authored by Anian Bühler's avatar Anian Bühler
Browse files

fixed comment-label for infix-command-blocks

parent 151262cf
Branches
No related tags found
1 merge request!1Dev preferences
...@@ -48,9 +48,8 @@ public class InfixBlockShape extends BlockShape { ...@@ -48,9 +48,8 @@ public class InfixBlockShape extends BlockShape {
// Trying left-aligned ports // Trying left-aligned ports
//added by letsgoING //added by letsgoING
//TODO: TEST
BlockConnector socket = block.getSocketAt(0); BlockConnector socket = block.getSocketAt(0);
int socketLabelOffset = (int) Math.max(socket.getLabel().length(), COMMAND_PORT_OFFSET); int socketLabelOffset = (int) Math.max(socket.getLabel().length(), BOTTOM_SOCKET_MIDDLE_SPACER);
Point2D p = BCS.addControlConnectorShape(gpBottom, socketLabelOffset + blockCornerRadius, true); Point2D p = BCS.addControlConnectorShape(gpBottom, socketLabelOffset + blockCornerRadius, true);
rb.updateSocketPoint(block.getAfterConnector(), p); rb.updateSocketPoint(block.getAfterConnector(), p);
...@@ -75,7 +74,6 @@ public class InfixBlockShape extends BlockShape { ...@@ -75,7 +74,6 @@ public class InfixBlockShape extends BlockShape {
(float) gpBottom.getCurrentPoint().getY()); (float) gpBottom.getCurrentPoint().getY());
} }
} else { //added by letsgoING } else { //added by letsgoING
//TODO: TEST
if (socketCounter > 0) { if (socketCounter > 0) {
gpBottom.lineTo( gpBottom.lineTo(
(float) gpBottom.getCurrentPoint().getX() + rb.getSocketLabelWidth(socketCounter), (float) gpBottom.getCurrentPoint().getX() + rb.getSocketLabelWidth(socketCounter),
......
...@@ -45,7 +45,7 @@ public class CommentLabel extends BlockControlLabel { ...@@ -45,7 +45,7 @@ public class CommentLabel extends BlockControlLabel {
y -= 2; y -= 2;
} }
if (rb.getBlock().isInfix() && rb.getBlock().getSocketAt(0) != null) { if (rb.getBlock().isInfix() && rb.getBlock().getSocketAt(0) != null && !rb.getBlock().isCommandBlock()) { //&& !rb.getBlock().isCommandBlock() added by letsgoING
if (!rb.getBlock().getSocketAt(0).hasBlock()) { if (!rb.getBlock().getSocketAt(0).hasBlock()) {
x += 30; x += 30;
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment