X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.editor%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Feditor%2Fui%2FEditorCanvas.java;h=aedaa481f4343b7831f07171c037ea7ef4e4eed1;hb=8bed58cd47f4e53a0a83e066d38864aa6875502f;hp=641aaa46620238507310f7962dc357f7dcc9ab28;hpb=db4075ec14984a406b863c153c873c17adc23dab;p=Mograsim.git diff --git a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java index 641aaa46..aedaa481 100644 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/ui/EditorCanvas.java @@ -22,9 +22,17 @@ public class EditorCanvas extends LogicUICanvas super(parent, style, editor.toBeEdited.submodel); handles = editor.handleManager.getHandles(); - editor.handleManager.addHandleAddedListener(h -> h.addRedrawListener(this::redrawThreadsafe)); + editor.handleManager.addHandleAddedListener(h -> + { + redrawThreadsafe(); + h.addRedrawListener(this::redrawThreadsafe); + }); // TODO: Is this even necessary? The Handle should be finalized by the gc - editor.handleManager.addHandleRemovedListener(h -> h.removeRedrawListener(this::redrawThreadsafe)); + editor.handleManager.addHandleRemovedListener(h -> + { + redrawThreadsafe(); + h.removeRedrawListener(this::redrawThreadsafe); + }); addZoomedRenderer(gc -> {