started transition tool (#109)

This commit is contained in:
itsmattkc
2018-11-04 19:32:33 +11:00
parent 266105ea9e
commit 0daa4ea607
9 changed files with 1073 additions and 2 deletions
+10 -2
View File
@@ -89,6 +89,7 @@ Timeline::Timeline(QWidget *parent) :
tool_buttons.append(ui->toolSlipButton);
tool_buttons.append(ui->toolRollingButton);
tool_buttons.append(ui->toolSlideButton);
tool_buttons.append(ui->toolTransitionButton);
ui->toolArrowButton->click();
@@ -1042,7 +1043,7 @@ void Timeline::deselect() {
}
long getFrameFromScreenPoint(double zoom, int x) {
long f = qRound((float) x / zoom);
long f = qCeil((float) x / zoom);
if (f < 0) {
return 0;
}
@@ -1050,7 +1051,7 @@ long getFrameFromScreenPoint(double zoom, int x) {
}
int getScreenPointFromFrame(double zoom, long frame) {
return (int) qRound(frame*zoom);
return (int) qFloor(frame*zoom);
}
long Timeline::getTimelineFrameFromScreenPoint(int x) {
@@ -1167,3 +1168,10 @@ void Timeline::on_recordButton_clicked() {
creating_object = ADD_OBJ_AUDIO;
}
}
void Timeline::on_toolTransitionButton_clicked() {
decheck_tool_buttons(sender());
ui->timeline_area->setCursor(Qt::CrossCursor);
tool = TIMELINE_TOOL_TRANSITION;
creating = false;
}