merged cursors #522

This commit is contained in:
itsmattkc
2019-03-09 17:21:22 +11:00
parent 653abf8042
commit 8cf3bd46a1
16 changed files with 99565 additions and 22 deletions
+6 -3
View File
@@ -36,6 +36,7 @@
#include "ui/resizablescrollbar.h"
#include "ui/audiomonitor.h"
#include "ui/flowlayout.h"
#include "ui/cursors.h"
#include "mainwindow.h"
#include "debug.h"
@@ -1706,7 +1707,7 @@ void Timeline::deselect() {
}
long getFrameFromScreenPoint(double zoom, int x) {
long f = qCeil(double(x) / zoom);
long f = qRound(double(x) / zoom);
if (f < 0) {
return 0;
}
@@ -1714,7 +1715,7 @@ long getFrameFromScreenPoint(double zoom, int x) {
}
int getScreenPointFromFrame(double zoom, long frame) {
return qFloor(double(frame)*zoom);
return qRound(double(frame)*zoom);
}
long Timeline::getTimelineFrameFromScreenPoint(int x) {
@@ -2039,9 +2040,11 @@ void Timeline::set_tool() {
creating = false;
switch (tool) {
case TIMELINE_TOOL_EDIT:
case TIMELINE_TOOL_RAZOR:
timeline_area->setCursor(Qt::IBeamCursor);
break;
case TIMELINE_TOOL_RAZOR:
timeline_area->setCursor(olive::Cursor_Razor);
break;
case TIMELINE_TOOL_HAND:
timeline_area->setCursor(Qt::OpenHandCursor);
break;