Describe the bug
When you create a polygon, add a few vertices, highlight a vertice, hit the delete key (thinking that would delete the vertex) it will delete the polygon. I assume that's correct behavior.
Then, using CTRL-Z to undo will result in a crash with a stack trace. Below is the stack trace:
HyperLap2D just crashed, stacktrace saved in: /Users/trevor/Library/Application Support/.hyperlap2d/crash/java-hyperlog.txt
System: Mac OS X 13.5.2 (HyperLap2D v0.1.3-SNAPSHOT)
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 129
at com.artemis.utils.Bag.get(Bag.java:196)
at com.artemis.ComponentMapper.get(ComponentMapper.java:65)
at games.rednblack.editor.renderer.utils.ComponentRetriever.get(ComponentRetriever.java:167)
at games.rednblack.editor.utils.runtime.SandboxComponentRetriever.get(SandboxComponentRetriever.java:12)
at games.rednblack.editor.controller.commands.component.UpdatePolygonVerticesCommand.undoAction(UpdatePolygonVerticesCommand.java:61)
at games.rednblack.editor.controller.commands.RevertibleCommand.callUndoAction(RevertibleCommand.java:51)
at games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand.callUndoAction(EntityModifyRevertibleCommand.java:45)
at games.rednblack.editor.proxy.CommandManager.undoCommand(CommandManager.java:63)
at games.rednblack.editor.view.stage.SandboxMediatorSandboxStageEventListener.keyDown(SandboxMediator.java:312)
at games.rednblack.editor.view.stage.input.SandboxInputAdapter.keyDown(SandboxInputAdapter.java:46)
at com.badlogic.gdx.InputMultiplexer.keyDown(InputMultiplexer.java:80)
at com.badlogic.gdx.InputEventQueue.drain(InputEventQueue.java:58)
at com.badlogic.gdx.backends.lwjgl3.DefaultLwjgl3Input.update(DefaultLwjgl3Input.java:189)
at
To Reproduce
Steps to reproduce the behavior:
Create a primitive polygon
Add a point
Press "Delete" key
Press CTRL-Z to undo
Observe the crash
Expected behavior
The polygon that was deleted should reappear on the scene
Screenshots
Describe the bug When you create a polygon, add a few vertices, highlight a vertice, hit the delete key (thinking that would delete the vertex) it will delete the polygon. I assume that's correct behavior.
Then, using CTRL-Z to undo will result in a crash with a stack trace. Below is the stack trace:
To Reproduce Steps to reproduce the behavior:
Expected behavior The polygon that was deleted should reappear on the scene Screenshots
https://github.com/rednblackgames/HyperLap2D/assets/28691656/f594b4a2-8b9c-4199-8377-2435fd5b3066
Desktop (please complete the following information):