Cleanups in bounding box rendering
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 3 Jun 2019 20:11:12 +0000 (22:11 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Mon, 3 Jun 2019 20:11:12 +0000 (22:11 +0200)
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/Am2901NANDBased.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java
net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java

index d63b41d..4035795 100644 (file)
@@ -35,10 +35,10 @@ public class Am2901NANDBased extends GUIComponent
                double posX = getBounds().x;
                double posY = getBounds().y;
 
+               gc.drawRectangle(getBounds());
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), 4, oldFont.getStyle());
                gc.setFont(labelFont);
-               gc.drawRectangle(posX, posY, 50, getBounds().height);
                for (int i = 0; i < inputNames.size(); i++)
                {
                        Point textExtent = gc.textExtent(inputNames.get(i));
index fd2f736..ec397c0 100644 (file)
@@ -38,7 +38,7 @@ public class GUIBitDisplay extends GUIComponent
                double posY = getBounds().y;
 
                // TODO maybe draw switch state too?
-               gc.drawRectangle(posX, posY, width, height);
+               gc.drawRectangle(getBounds());
                String label = bitDisplay == null ? BitVectorFormatter.formatAsString(null)
                                : BitVectorFormatter.formatAsString(bitDisplay.getDisplayedValue());
                Font oldFont = gc.getFont();
index 0993024..8b9bcd9 100644 (file)
@@ -40,7 +40,7 @@ public class GUIManualSwitch extends GUIComponent
                double posY = getBounds().y;
 
                // TODO maybe draw switch state too?
-               gc.drawRectangle(posX, posY, width, height);
+               gc.drawRectangle(getBounds());
                String label = BitVectorFormatter.formatValueAsString(end);
                Font oldFont = gc.getFont();
                Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());