Skip to content

Commit 8cc588b

Browse files
committed
Pass commandStack to TimelinePanel for undo/redo support
1 parent c75447e commit 8cc588b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

editor/src/main/java/com/jvn/editor/ui/actioneditor/PuppeteerWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public PuppeteerWindow(AnimationProject project) {
258258
setHeight(900);
259259

260260
entitySelector = new EntitySelector();
261-
timelinePanel = new TimelinePanel(this.project);
261+
timelinePanel = new TimelinePanel(this.project, commandStack);
262262
selectionModel = timelinePanel.getSelectionModel();
263263
keyframeEditor = new KeyframeEditor();
264264
keyframeEditor.setTimelineDurationMs(this.project.getTotalDurationMs());

editor/src/main/java/com/jvn/editor/ui/actioneditor/TimelinePanel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ private static Color trackColorFor(PropertyType prop) {
7272
}
7373

7474
private final AnimationProject project;
75+
private final PuppeteerCommand.Stack commandStack;
7576
private final Canvas canvas;
7677
private final ScrollPane scrollPane;
7778
private final Pane canvasContainer;
@@ -118,7 +119,12 @@ private record TrackRow(EntityTrack track,
118119
private record KeyframeHit(TrackRow row, Keyframe keyframe) {}
119120

120121
public TimelinePanel(AnimationProject project) {
122+
this(project, null);
123+
}
124+
125+
public TimelinePanel(AnimationProject project, PuppeteerCommand.Stack commandStack) {
121126
this.project = project;
127+
this.commandStack = commandStack;
122128

123129
canvas = new Canvas(800, 400);
124130
canvasContainer = new Pane(canvas);

0 commit comments

Comments
 (0)