diff --git a/CMakeLists.txt b/CMakeLists.txt index 4115edd31..296b10a91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,7 @@ list(APPEND OLIVE_INCLUDE_DIRS ${OPENEXR_INCLUDES}) list(APPEND OLIVE_LIBRARIES olivecore) list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/core/include) + # Link Qt set(QT_LIBRARIES Core diff --git a/app/widget/timebased/timescaledobject.cpp b/app/widget/timebased/timescaledobject.cpp index c28d2bc29..c27072738 100644 --- a/app/widget/timebased/timescaledobject.cpp +++ b/app/widget/timebased/timescaledobject.cpp @@ -58,6 +58,9 @@ const double &TimeScaledObject::timebase_dbl() const rational TimeScaledObject::SceneToTime(const double &x, const double &x_scale, const rational &timebase, bool round) { + if (timebase.isNull()) { + return rational(); + } double unscaled_time = x / x_scale / timebase.toDouble(); // Adjust screen point by scale and timebase @@ -87,16 +90,25 @@ rational TimeScaledObject::SceneToTimeNoGrid(const double &x, double TimeScaledObject::TimeToScene(const rational &time) const { + if (timebase_.isNull()) { + return 0.0; + } return time.toDouble() * scale_; } rational TimeScaledObject::SceneToTime(const double &x, bool round) const { + if (timebase_.isNull()) { + return rational(); + } return SceneToTime(x, scale_, timebase_, round); } rational TimeScaledObject::SceneToTimeNoGrid(const double &x) const { + if (timebase_.isNull()) { + return rational::fromDouble(x / scale_); + } return SceneToTimeNoGrid(x, scale_); } diff --git a/app/widget/viewer/viewerdisplay.cpp b/app/widget/viewer/viewerdisplay.cpp index 1020e4b4a..501c9bf51 100644 --- a/app/widget/viewer/viewerdisplay.cpp +++ b/app/widget/viewer/viewerdisplay.cpp @@ -374,7 +374,7 @@ bool ViewerDisplayWidget::eventFilter(QObject *o, QEvent *e) void ViewerDisplayWidget::OnPaint() { // Clear background to empty - QColor bg_color = show_widget_background_ ? palette().window().color() : + QColor bg_color = show_widget_background_ ? palette().window().color() : Qt::black; renderer()->ClearDestination(nullptr, bg_color.redF(), bg_color.greenF(), bg_color.blueF());