Fix movement of keyframe via GuiEditKeyframe not updating selected keyframe

Selecting a keyframe, double clicking it to open the gui, changing the
timestamp, saving and then clicking the Add/Remove Keyframe button used to
crash the client. This is fixed by updating the selection whenever the time is
changed.
This commit is contained in:
johni0702
2017-04-13 18:18:17 +02:00
parent f58fa8f9c2
commit fe6ded0143

View File

@@ -109,6 +109,9 @@ public abstract class GuiEditKeyframe<T extends GuiEditKeyframe<T>> extends Abst
if (newTime != time) { if (newTime != time) {
change = CombinedChange.createFromApplied(change, change = CombinedChange.createFromApplied(change,
gui.getMod().getCurrentTimeline().moveKeyframe(path, time, newTime)); gui.getMod().getCurrentTimeline().moveKeyframe(path, time, newTime));
if (gui.getMod().getSelectedPath() == path && gui.getMod().getSelectedTime() == time) {
gui.getMod().setSelected(path, newTime);
}
} }
gui.getMod().getCurrentTimeline().getTimeline().pushChange(change); gui.getMod().getCurrentTimeline().getTimeline().pushChange(change);
close(); close();