WireCrossPoint now renders at the correct location
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 29 May 2019 15:40:05 +0000 (17:40 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 29 May 2019 15:40:05 +0000 (17:40 +0200)
LogicUI/src/era/mi/gui/LogicUICanvas.java
LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java

index 7faefe3..da724d8 100644 (file)
@@ -84,7 +84,7 @@ public class LogicUICanvas extends ZoomableCanvas
        private void drawComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion)
        {
                component.render(gc, visibleRegion);
        private void drawComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion)
        {
                component.render(gc, visibleRegion);
-               gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_CYAN));
+               gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN));
                for (Pin p : component.getPins())
                {
                        Point pos = p.getPos();
                for (Pin p : component.getPins())
                {
                        Point pos = p.getPos();
index 724de54..04c5f1e 100644 (file)
@@ -26,7 +26,9 @@ public class WireCrossPoint extends GUIComponent
        @Override
        public void render(GeneralGC gc, Rectangle visibleRegion)
        {
        @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)
        }
 
        public void setLogicModelBinding(ReadEnd end)