RowItem: Split appart visual and layout v offsets
[pulseview.git] / pv / view / view.cpp
index 37c3b14a1380f45994648099944625b8f4295c21..d48bbabebd4088e0b49128e00f5152577350b6b6 100644 (file)
@@ -320,20 +320,6 @@ const QPoint& View::hover_point() const
        return _hover_point;
 }
 
-void View::normalize_layout()
-{
-       int v_min = INT_MAX;
-       for (const shared_ptr<RowItem> r : *this)
-               v_min = min(r->v_offset(), v_min);
-
-       const int delta = -min(v_min, 0);
-       for (shared_ptr<RowItem> r : *this)
-               r->set_v_offset(r->v_offset() + delta);
-
-       verticalScrollBar()->setSliderPosition(_v_offset + delta);
-       v_scroll_value_changed(verticalScrollBar()->sliderPosition());
-}
-
 void View::update_viewport()
 {
        assert(_viewport);
@@ -517,13 +503,12 @@ void View::signals_changed()
                const pair<int, int> extents = r->v_extents();
                if (r->enabled())
                        offset += -extents.first;
-               r->set_v_offset(offset);
+               r->force_to_v_offset(offset);
                if (r->enabled())
                        offset += extents.second;
        }
 
        update_layout();
-       normalize_layout();
 
        // Update the child widgets
        _header->signals_updated();