From b10965ee92d8b5214cc4847b3b252b1d89deda7b Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Fri, 25 May 2018 20:48:37 +0300 Subject: [PATCH] #0 [UI] Fixed zooming for charts (histogram, arbitrary value) with mouse wheel --- profiler_gui/graphics_slider_area.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiler_gui/graphics_slider_area.cpp b/profiler_gui/graphics_slider_area.cpp index 4300be2..48fa914 100644 --- a/profiler_gui/graphics_slider_area.cpp +++ b/profiler_gui/graphics_slider_area.cpp @@ -539,12 +539,12 @@ void GraphicsSliderArea::wheelEvent(QWheelEvent* _event) { const auto w = m_slider->halfwidth() * (_event->delta() < 0 ? profiler_gui::SCALING_COEFFICIENT : profiler_gui::SCALING_COEFFICIENT_INV); setValue(mapToScene(_event->pos()).x() - m_minimumValue - w); - emit EASY_GLOBALS.events.chartWheeled(w * m_windowScale, _event->delta()); + emit EASY_GLOBALS.events.chartWheeled(m_value + w * m_windowScale, _event->delta()); } else { auto x = static_cast(_event->pos().x()) / m_windowScale; - if (m_bBindMode) + if (m_bBindMode) // check m_bBindMode because it may differ from bindMode() for arbitrary value complexity chart x *= sliderWidth() / range(); emit EASY_GLOBALS.events.chartWheeled(m_value + x, _event->delta()); }