[path editor] Setting snap x & y to 0 causes divide by 0 error #306

Closed
faissaloo opened this Issue Jul 9, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@faissaloo

faissaloo commented Jul 9, 2016

Set snap x and y to 0 then try to move an existing point:


Operating System: Linux
Version: 4.4.0-28-generic
Architecture: amd64

Java Name: OpenJDK 64-Bit Server VM
Java Vendor: Oracle Corporation
Version: 1.8.0_91

Available processors (cores): 4
Free memory (bytes): 50478312
Maximum memory (bytes): 430964736
Total memory available to JVM (bytes): 218103808

File system root: /
Total space (bytes): 28875468800
Free space (bytes): 5478899712
Usable space (bytes): 3988475904

Stack trace:
java.lang.ArithmeticException: / by zero
    at org.lateralgm.main.Util.negDiv(Util.java:1136)
    at org.lateralgm.components.visual.PathEditor.movePathPoint(PathEditor.java:219)
    at org.lateralgm.components.visual.PathEditor.mouseEvent(PathEditor.java:188)
    at org.lateralgm.components.visual.PathEditor.processMouseMotionEvent(PathEditor.java:232)
    at java.awt.Component.processEvent(Component.java:6304)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4542)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

java.lang.ArithmeticException: / by zero
    at org.lateralgm.main.Util.negDiv(Util.java:1136)
    at org.lateralgm.components.visual.PathEditor.movePathPoint(PathEditor.java:219)
    at org.lateralgm.components.visual.PathEditor.mouseEvent(PathEditor.java:188)
    at org.lateralgm.components.visual.PathEditor.processMouseMotionEvent(PathEditor.java:232)
    at java.awt.Component.processEvent(Component.java:6304)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4542)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Aug 13, 2016

Collaborator

This is not a regression and the issue exists in lgm16b4 as well. The solution is to make the snap number fields use 1 as a minimum value like the ones in the room editor do. This is also what GMS does, they don't even let you set it to 0 and neither should we.

Collaborator

RobertBColton commented Aug 13, 2016

This is not a regression and the issue exists in lgm16b4 as well. The solution is to make the snap number fields use 1 as a minimum value like the ones in the room editor do. This is also what GMS does, they don't even let you set it to 0 and neither should we.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Oct 1, 2016

Collaborator

I just fixed this in #313 on master. It will be in the new LGM release tonight.

Collaborator

RobertBColton commented Oct 1, 2016

I just fixed this in #313 on master. It will be in the new LGM release tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment