Made pin drawing optional
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 29 May 2019 15:44:54 +0000 (17:44 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 29 May 2019 15:44:54 +0000 (17:44 +0200)
LogicUI/src/era/mi/gui/LogicUICanvas.java

index fb73405..b64b842 100644 (file)
@@ -22,6 +22,8 @@ import net.haspamelodica.swt.helper.zoomablecanvas.ZoomableCanvas;
  */\r
 public class LogicUICanvas extends ZoomableCanvas\r
 {\r
+       private static final boolean DRAW_PINS = false;\r
+\r
        private final ViewModel model;\r
 \r
        public LogicUICanvas(Composite parent, int style, ViewModel model)\r
@@ -84,11 +86,14 @@ public class LogicUICanvas extends ZoomableCanvas
        private void drawComponent(GeneralGC gc, GUIComponent component, Rectangle visibleRegion)\r
        {\r
                component.render(gc, visibleRegion);\r
-               gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN));\r
-               for (Pin p : component.getPins())\r
+               if (DRAW_PINS)\r
                {\r
-                       Point pos = p.getPos();\r
-                       gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);\r
+                       gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_CYAN));\r
+                       for (Pin p : component.getPins())\r
+                       {\r
+                               Point pos = p.getPos();\r
+                               gc.fillOval(pos.x - 1, pos.y - 1, 2, 2);\r
+                       }\r
                }\r
        }\r
 \r