diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/buttons/RoundButton.java b/app/src/main/java/com/codigoparallevar/minicards/parts/buttons/RoundButton.java index d6f9b38..c421613 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/buttons/RoundButton.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/buttons/RoundButton.java @@ -115,11 +115,11 @@ public class RoundButton implements Part { } private int getOutputConnectorCenterX() { - return _xCenter + _outerRadius; + return _xCenter; } private int getOutputConnectorCenterY() { - return _yCenter; + return _yCenter + _outerRadius; } private int getOutputConnectRadius() { diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java index 4629bc3..c99db56 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Ticker.java @@ -147,7 +147,8 @@ public class Ticker implements Part { Paint connectorPaint = new Paint(Paint.ANTI_ALIAS_FLAG); connectorPaint.setColor(Color.RED); - canvas.drawCircle(_right, getOutputConnectorCenterY(), + canvas.drawCircle(getOutputConnectorCenterX(), + getOutputConnectorCenterY(), getOutputConnectRadius(), connectorPaint); } @@ -289,11 +290,11 @@ public class Ticker implements Part { private int getOutputConnectorCenterX() { - return _right; + return (_left + _right) / 2; } private int getOutputConnectorCenterY() { - return (_top + _bottom) / 2; + return _bottom; } private int getOutputConnectRadius() { diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Toggle.java b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Toggle.java index 4d7132f..f7b6dd7 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Toggle.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/logic/Toggle.java @@ -132,14 +132,16 @@ public class Toggle implements Part { inputConnectorPaint.setColor(Color.YELLOW); canvas.drawCircle( - getInputConnectorCenterX(), getInputConnectorCenterY(), + getInputConnectorCenterX(), + getInputConnectorCenterY(), getInputConnectRadius(), inputConnectorPaint); Paint outputConnectorPaint = new Paint(Paint.ANTI_ALIAS_FLAG); outputConnectorPaint.setColor(Color.RED); - canvas.drawCircle(_right, getOutputConnectorCenterY(), + canvas.drawCircle(getOutputConnectorCenterX(), + getOutputConnectorCenterY(), getOutputConnectRadius(), outputConnectorPaint); } @@ -306,7 +308,7 @@ public class Toggle implements Part { } public int getInputConnectorCenterX() { - return get_left(); + return (get_left() + get_right()) / 2; } private int getInputConnectRadius() { @@ -314,15 +316,15 @@ public class Toggle implements Part { } public int getInputConnectorCenterY() { - return (get_top() + get_bottom()) / 2; + return get_top(); } private int getOutputConnectorCenterX() { - return _right; + return (get_left() + get_right()) / 2; } private int getOutputConnectorCenterY() { - return (_top + _bottom) / 2; + return get_bottom(); } private int getOutputConnectRadius() { diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/samples/ColorBox.java b/app/src/main/java/com/codigoparallevar/minicards/parts/samples/ColorBox.java index 57613f6..0b16e36 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/samples/ColorBox.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/samples/ColorBox.java @@ -109,7 +109,8 @@ public class ColorBox implements Part { connectorPaint.setColor(Color.YELLOW); canvas.drawCircle( - getInputConnectorCenterX(), getInputConnectorCenterY(), + getInputConnectorCenterX(), + getInputConnectorCenterY(), getInputConnectRadius(), connectorPaint); } @@ -238,7 +239,7 @@ public class ColorBox implements Part { } public int getInputConnectorCenterX() { - return get_left(); + return (get_left() + get_right()) / 2; } private int getInputConnectRadius() { @@ -246,7 +247,7 @@ public class ColorBox implements Part { } public int getInputConnectorCenterY() { - return (get_top() + get_bottom()) / 2; + return get_top(); } public static PartInstantiator getInstantiator() { diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/strings/ConvertToString.java b/app/src/main/java/com/codigoparallevar/minicards/parts/strings/ConvertToString.java index 19535b4..09491d2 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/strings/ConvertToString.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/strings/ConvertToString.java @@ -110,7 +110,7 @@ public class ConvertToString implements Part { drawWires(canvas, devMode); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); - paint.setColor(Color.WHITE); + paint.setColor(Color.BLACK); canvas.drawRect( new Rect(_left, _top, _right, _bottom), @@ -120,8 +120,8 @@ public class ConvertToString implements Part { textPaint.setColor(Color.GREEN); textPaint.setTextSize(100); canvas.drawText(_lastValue, - _left, - _top - 5, + _left + 10, + _bottom - 10, textPaint); } } @@ -131,14 +131,16 @@ public class ConvertToString implements Part { inputConnectorPaint.setColor(Color.YELLOW); canvas.drawCircle( - getInputConnectorCenterX(), getInputConnectorCenterY(), + getInputConnectorCenterX(), + getInputConnectorCenterY(), getInputConnectRadius(), inputConnectorPaint); Paint outputConnectorPaint = new Paint(Paint.ANTI_ALIAS_FLAG); outputConnectorPaint.setColor(Color.RED); - canvas.drawCircle(_right, getOutputConnectorCenterY(), + canvas.drawCircle(getOutputConnectorCenterX(), + getOutputConnectorCenterY(), getOutputConnectRadius(), outputConnectorPaint); } @@ -315,7 +317,7 @@ public class ConvertToString implements Part { } public int getInputConnectorCenterX() { - return get_left(); + return (get_left() + get_right()) / 2; } private int getInputConnectRadius() { @@ -323,15 +325,15 @@ public class ConvertToString implements Part { } public int getInputConnectorCenterY() { - return (get_top() + get_bottom()) / 2; + return get_top(); } private int getOutputConnectorCenterX() { - return _right; + return (get_left() + get_right()) / 2; } private int getOutputConnectorCenterY() { - return (_top + _bottom) / 2; + return get_bottom(); } private int getOutputConnectRadius() { diff --git a/app/src/main/java/com/codigoparallevar/minicards/types/connectors/Wiring/Wire.java b/app/src/main/java/com/codigoparallevar/minicards/types/connectors/Wiring/Wire.java index 10cf453..d292ad0 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/types/connectors/Wiring/Wire.java +++ b/app/src/main/java/com/codigoparallevar/minicards/types/connectors/Wiring/Wire.java @@ -53,13 +53,13 @@ public class Wire