diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 0036be478..0366504c6 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -334,19 +334,9 @@ TimelinePanel::update_tool_buttons() void TimelinePanel::update_zoom_buttons() { - REQUIRE(timelineWidget); - - int64_t current_scale = - timelineWidget->get_state()->get_view_window().get_time_scale(); - - double linear_scale = - (double) current_scale / (double) TimelineWidget::MaxScale; - - /* We have to Revese the Smoothing */ - double new_relative_scale = - pow(linear_scale,(1.0/9.0)); - - timelineWidget->zoom_view (new_relative_scale); +/* This function is no longer needed + * TODO: Let the ZoomScaleWidget perform + * the update on its own */ } void diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 52008f0cc..b971477c6 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -41,7 +41,8 @@ namespace widgets { const int TimelineWidget::TrackPadding = 1; const int TimelineWidget::HeaderWidth = 150; const int TimelineWidget::HeaderIndentWidth = 10; -const double TimelineWidget::ZoomIncrement = 1.25; +const double TimelineWidget::ZoomIncrement = 1.25; // Not currently used +const double TimelineWidget::ZoomSmoothing = 9.0; const int64_t TimelineWidget::MaxScale = 30000000; // 30 Million TimelineWidget::TimelineWidget(shared_ptr source_state) diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 39901305a..b5d57c667 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -285,6 +285,7 @@ public: * to 30000000 lumiera::Time increments. */ static const int64_t MaxScale; + static const double ZoomSmoothing; protected: static const int TrackPadding; diff --git a/src/gui/widgets/timeline/timeline-view-window.cpp b/src/gui/widgets/timeline/timeline-view-window.cpp index 07e017e07..9e80d2f9c 100644 --- a/src/gui/widgets/timeline/timeline-view-window.cpp +++ b/src/gui/widgets/timeline/timeline-view-window.cpp @@ -88,9 +88,10 @@ TimelineViewWindow::set_time_scale(double ratio) void TimelineViewWindow::zoom_view(int point, double time_scale_ratio) { - TODO("Find a Central place for a Zoom Smoothing Factor Variable. Right now it is hard coded at 9.0"); + // Apply the smoothing factor int64_t new_time_scale = - (int64_t)( pow(time_scale_ratio, 9.0) * (double)TimelineWidget::MaxScale); + (int64_t)( pow(time_scale_ratio, TimelineWidget::ZoomSmoothing) * + (double)TimelineWidget::MaxScale); /* Prevent Zooming in To Close and Far */ if(new_time_scale < 1) diff --git a/src/gui/widgets/timeline/timeline-zoom-scale.cpp b/src/gui/widgets/timeline/timeline-zoom-scale.cpp index 2ee413c71..dfa71f858 100644 --- a/src/gui/widgets/timeline/timeline-zoom-scale.cpp +++ b/src/gui/widgets/timeline/timeline-zoom-scale.cpp @@ -113,7 +113,7 @@ TimelineZoomScale::on_timeline_state_changed (shared_ptr newState /* We have to Revese the Smoothing */ double new_relative_scale = - pow(linear_scale,(1.0/9.0)); + pow(linear_scale,(1.0 / TimelineWidget::ZoomSmoothing)); adjustment.set_value(new_relative_scale); }