From 533a3fe1578af4ac450ee677c6873e4579d1cfc3 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Wed, 29 May 2019 17:40:05 +0200 Subject: [PATCH] WireCrossPoint now renders at the correct location --- LogicUI/src/era/mi/gui/LogicUICanvas.java | 2 +- LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/LogicUI/src/era/mi/gui/LogicUICanvas.java b/LogicUI/src/era/mi/gui/LogicUICanvas.java index 7faefe39..da724d83 100644 --- a/LogicUI/src/era/mi/gui/LogicUICanvas.java +++ b/LogicUI/src/era/mi/gui/LogicUICanvas.java @@ -84,7 +84,7 @@ public class LogicUICanvas extends ZoomableCanvas 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(); diff --git a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java index 724de54b..04c5f1e8 100644 --- a/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java +++ b/LogicUI/src/era/mi/gui/model/wires/WireCrossPoint.java @@ -26,7 +26,9 @@ public class WireCrossPoint extends GUIComponent @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) -- 2.17.1