Allow moving the keyframe timeline cursor by dragging (fixes #18)
This commit is contained in:
@@ -243,6 +243,15 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
|||||||
@Override
|
@Override
|
||||||
public boolean mouseDrag(ReadablePoint position, int button, long timeSinceLastCall) {
|
public boolean mouseDrag(ReadablePoint position, int button, long timeSinceLastCall) {
|
||||||
if (!dragging) {
|
if (!dragging) {
|
||||||
|
if (button == 0) {
|
||||||
|
// Left click, the user might try to move the cursor by clicking and holding
|
||||||
|
int time = getTimeAt(position.getX(), position.getY());
|
||||||
|
if (time != -1) {
|
||||||
|
// and they are still on the timeline, so update the time appropriately
|
||||||
|
setCursorPosition(time);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user