merayen / Elastic

Elastic - Synthesizer DAW
1 stars 1 forks source link

Crash when splitting horizontally #18

Open merayen opened 5 years ago

merayen commented 5 years ago

When dragging from lowest area of screen, with just 1 view, it tries to resize the only single panel instead of creating a new one. Fix. Layout.java looks bad anyway, waste some time to rewrite it in Kotlin?

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Should not happen
    at net.merayen.elastic.ui.objects.top.viewport.Layout.getRuler(Layout.java:333)
    at net.merayen.elastic.ui.objects.top.viewport.Layout.resizeHeight(Layout.java:199)
    at net.merayen.elastic.ui.objects.top.viewport.ViewportContainer$1.onMouseDrag(ViewportContainer.java:113)
    at net.merayen.elastic.ui.util.MouseHandler.handle(MouseHandler.java:116)
    at net.merayen.elastic.ui.objects.top.viewport.ViewportContainer.onEvent(ViewportContainer.java:173)
    at net.merayen.elastic.ui.Supervisor.internalUpdate(Supervisor.kt:55)
    at net.merayen.elastic.ui.Supervisor.internalUpdate(Supervisor.kt:61)
    at net.merayen.elastic.ui.Supervisor.internalUpdate(Supervisor.kt:61)
    at net.merayen.elastic.ui.Supervisor.draw(Supervisor.kt:15)
    at net.merayen.elastic.system.UIBridge$1.onDraw(UIBridge.kt:32)
    at net.merayen.elastic.ui.SurfaceHandler$createSurface$surface$1.onDraw(SurfaceHandler.kt:45)
    at net.merayen.elastic.ui.surface.Swing$LolPanel.paintComponent(Swing.kt:142)
merayen commented 5 years ago

image When dragging this line upwards, it crashes.