From: Daniel Kirschten Date: Mon, 3 Jun 2019 20:11:12 +0000 (+0200) Subject: Cleanups in bounding box rendering X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;ds=inline;h=4dca33ac72b3f476ab069d6627f5e824c4a55a5b;p=Mograsim.git Cleanups in bounding box rendering --- diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/Am2901NANDBased.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/Am2901NANDBased.java index d63b41da..40357957 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/Am2901NANDBased.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/Am2901NANDBased.java @@ -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)); diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java index fd2f736c..ec397c02 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIBitDisplay.java @@ -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(); diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java index 0993024d..8b9bcd90 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIManualSwitch.java @@ -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());