implemented bulk of curve editor's functionality

While certainly not entirely complete yet, this implements most of the UI
functionality of the graph editor.
This commit is contained in:
itsmattkc
2019-12-28 18:26:37 +11:00
parent b65abe4881
commit 26cafa7936
21 changed files with 603 additions and 36 deletions
+4 -3
View File
@@ -248,13 +248,14 @@ void TimelineWidget::PointerTool::InitiateDrag(const TimelineCoordinate &mouse_p
Timeline::MovementMode trim_mode = Timeline::kNone;
// FIXME: Hardcoded number
const int kTrimHandle = 10;
double kTrimHandle = qMax(10.0, parent()->TimeToScene(parent()->timebase()));
qreal mouse_x = parent()->TimeToScene(mouse_pos.GetFrame());
if (trimming_allowed_ && mouse_x < clicked_item->x() + kTrimHandle) {
if (trimming_allowed_ && mouse_x <= clicked_item->x() + kTrimHandle) {
trim_mode = Timeline::kTrimIn;
} else if (trimming_allowed_ && mouse_x > clicked_item->x() + clicked_item->rect().right() - kTrimHandle) {
} else if (trimming_allowed_ && mouse_x >= clicked_item->x() + clicked_item->rect().right() - kTrimHandle) {
trim_mode = Timeline::kTrimOut;
} else if (movement_allowed_) {
// Some derived classes don't allow movement