X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fcomponents%2FGUIManualSwitch.java;h=c45224ab6df513fbd1d1ae6953d45528c2702df0;hb=cd0a740c20afae7181c797e793666a34e51b1864;hp=b215cff86972c3843e6f1ea359288b704a2e7e4c;hpb=533a3fe1578af4ac450ee677c6873e4579d1cfc3;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/model/components/GUIManualSwitch.java b/LogicUI/src/era/mi/gui/model/components/GUIManualSwitch.java index b215cff8..c45224ab 100644 --- a/LogicUI/src/era/mi/gui/model/components/GUIManualSwitch.java +++ b/LogicUI/src/era/mi/gui/model/components/GUIManualSwitch.java @@ -31,13 +31,16 @@ public class GUIManualSwitch extends GUIComponent @Override public void render(GeneralGC gc, Rectangle visibleRegion) { - gc.drawRectangle(0, 0, width, height); + double posX = getBounds().x; + double posY = getBounds().y; + + gc.drawRectangle(posX, posY, width, height); String label = BitVectorFormatter.formatValueAsString(end); Font oldFont = gc.getFont(); Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle()); gc.setFont(labelFont); Point textExtent = gc.textExtent(label); - gc.drawText(label, (width - textExtent.x) / 2, (height - textExtent.y) / 2, true); + gc.drawText(label, posX + (width - textExtent.x) / 2, posY + (height - textExtent.y) / 2, true); gc.setFont(oldFont); }