import java.util.Collection;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import net.haspamelodica.swt.helper.gcs.TranslatedGC;
import net.mograsim.logic.model.LogicUICanvas;
import net.mograsim.logic.model.editor.Editor;
import net.mograsim.logic.model.editor.handles.Handle;
-import net.mograsim.preferences.Preferences;
//TODO: Remove Inheritance
public class EditorCanvas extends LogicUICanvas
addZoomedRenderer(gc ->
{
Rectangle visibleRegion = new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom);
- Color background = Preferences.current().getColor("net.mograsim.logic.model.color.background");
- if (background != null)
- setBackground(background);// this.setBackground, not gc.setBackground to have the background fill the
- // canvas
TranslatedGC tgc = new TranslatedGC(gc, 0.0d, 0.0d, 1 / editor.toBeEdited.getSubmodelScale(), false);
editor.toBeEdited.getOutlineRenderer().render(tgc, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom));
this.model = model;
+ Color background = Preferences.current().getColor("net.mograsim.logic.model.color.background");
+ if (background != null)
+ setBackground(background);
+
LogicUIRenderer renderer = new LogicUIRenderer(model);
- addZoomedRenderer(gc ->
- {
- Color background = Preferences.current().getColor("net.mograsim.logic.model.color.background");
- if (background != null)
- setBackground(background);// this.setBackground, not gc.setBackground to have the background fill the canvas
- renderer.render(gc, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom));
- });
+ addZoomedRenderer(gc -> renderer.render(gc, new Rectangle(-offX / zoom, -offY / zoom, gW / zoom, gH / zoom)));
model.setRedrawHandler(() ->
{
if (!isDisposed())