X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fwires%2FWireCrossPoint.java;fp=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fwires%2FWireCrossPoint.java;h=04c5f1e8406cc3ef892f693e37d740478de08e5f;hb=d27165bc7b5dcff6c1e3d7f88f7195c5418ab9df;hp=73d98f53ba1d384cb150b12c7139f08ee06b7d73;hpb=86f2e11d28a4100a7fe142e103b7b5eeb9de4214;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java index 73d98f53..04c5f1e8 100644 --- a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java +++ b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java @@ -10,6 +10,8 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; public class WireCrossPoint extends GUIComponent { + private final Pin pin; + private ReadEnd end; private final int logicWidth; @@ -18,13 +20,15 @@ public class WireCrossPoint extends GUIComponent super(model); this.logicWidth = logicWidth; setSize(0, 0); - addPin(new Pin(this, logicWidth, 0, 0)); + addPin(this.pin = new Pin(this, logicWidth, 0, 0)); } @Override public void render(GeneralGC gc, Rectangle visibleRegion) { - ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end), () -> gc.fillOval(-1, -1, 2, 2)); + Rectangle bounds = getBounds(); + ColorHelper.executeWithDifferentBackground(gc, BitVectorFormatter.formatAsColor(end), + () -> gc.fillOval(bounds.x - 1, bounds.y - 1, 2, 2)); } public void setLogicModelBinding(ReadEnd end) @@ -37,4 +41,9 @@ public class WireCrossPoint extends GUIComponent { return logicWidth; } + + public Pin getPin() + { + return pin; + } } \ No newline at end of file