X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FGUIMerger.java;h=40f9ebdd20977e23c766e86c6bcb12a8dd898892;hb=a936af6541ed4a9e6857d9944c528d394b8f63fc;hp=287e4374cd5d7bfde462eb5c01705b1d647e40a0;hpb=28fa1dd47af605515181059efb36477a358aec21;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIMerger.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIMerger.java index 287e4374..40f9ebdd 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIMerger.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIMerger.java @@ -20,12 +20,12 @@ import net.mograsim.preferences.Preferences; public class GUIMerger extends GUIComponent { - private static final double width = 20; + private static final double width = 10; private static final double heightPerPin = 10; public final int logicWidth; - private ReadEnd[] inputEnds; + private final ReadEnd[] inputEnds; private ReadEnd outputEnd; public GUIMerger(ViewModelModifiable model, int logicWidth, String name) @@ -37,6 +37,7 @@ public class GUIMerger extends GUIComponent for (int i = 0; i < logicWidth; i++, inputHeight += 10) addPin(new Pin(this, "I" + i, 1, 0, inputHeight)); addPin(new Pin(this, "O", logicWidth, width, logicWidth * heightPerPin / 2)); + inputEnds = new ReadEnd[logicWidth]; } @Override @@ -69,7 +70,7 @@ public class GUIMerger extends GUIComponent public void setLogicModelBinding(ReadEnd[] inputEnds, ReadEnd outputEnd) { - this.inputEnds = inputEnds; + System.arraycopy(inputEnds, 0, this.inputEnds, 0, logicWidth); this.outputEnd = outputEnd; }