X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2FLogicUIRenderer.java;h=56ecffb76c6a4473471d90b8c6ede23da82d33b1;hb=5ece0acf049bf9af2933f513fe0206565681f622;hp=4b451fc4a85e335cfcd88211d06e0d30cd86e214;hpb=738ca98b4d80225a3a80b42d3ac690fe0fa3f90f;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java index 4b451fc4..56ecffb7 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/LogicUIRenderer.java @@ -22,6 +22,8 @@ public class LogicUIRenderer public void render(GeneralGC gc, Rectangle visibleRegion) { + gc.setAntialias(SWT.ON); + gc.setClipping(visibleRegion); gc.setLineWidth(.5); model.getWires().forEach(w -> { @@ -30,7 +32,7 @@ public class LogicUIRenderer if (visibleRegion.intersects(bounds.x - lw, bounds.y - lw, bounds.width + lw + lw, bounds.height + lw + lw)) w.render(gc); }); - model.getComponents().forEach(c -> renderComponent(gc, c, visibleRegion)); + model.getComponentsByName().values().forEach(c -> renderComponent(gc, c, visibleRegion)); } private static void renderComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion) @@ -43,7 +45,7 @@ public class LogicUIRenderer if (DRAW_PINS) { gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_DARK_CYAN)); - for (Pin p : component.getPins()) + for (Pin p : component.getPins().values()) { Point pos = p.getPos(); gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);