Auto-scroll keyframe timeline to cursor where possible (closes #291)
This commit is contained in:
2
jGui
2
jGui
Submodule jGui updated: 3ec4b51e12...23e291e0c3
@@ -162,7 +162,7 @@ public class GuiPathing {
|
||||
@Override
|
||||
public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) {
|
||||
if (player.isActive()) {
|
||||
setCursorPosition((int) player.getTimePassed());
|
||||
setCursorPosition((int) player.getTimePassed()).ensureCursorVisibleWithPadding();
|
||||
}
|
||||
super.draw(renderer, size, renderInfo);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ public class GuiPathing {
|
||||
// Cursor time passed
|
||||
int cursorPassed = (int) (timePassed / speed);
|
||||
// Move cursor to new position
|
||||
timeline.setCursorPosition(keyframeCursor + cursorPassed);
|
||||
timeline.setCursorPosition(keyframeCursor + cursorPassed).ensureCursorVisibleWithPadding();
|
||||
// Deselect keyframe to allow the user to add a new one right away
|
||||
mod.setSelected(null, 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user