]> sigrok.org Git - pulseview.git/commitdiff
Viewport: Allow for vertical dragging as well
authorSoeren Apel <redacted>
Mon, 28 Dec 2015 20:48:30 +0000 (21:48 +0100)
committerSoeren Apel <redacted>
Mon, 28 Dec 2015 20:48:30 +0000 (21:48 +0100)
pv/view/viewport.cpp
pv/view/viewport.hpp

index 5cb65079f1c98fe61242862404b15c908a6d3602..9e136664f5078b1510dbef92d57c972b61d981ba 100644 (file)
@@ -78,6 +78,7 @@ void Viewport::item_hover(const shared_ptr<ViewItem> &item)
 void Viewport::drag()
 {
        drag_offset_ = view_.offset();
+       drag_v_offset_ = view_.owner_visual_v_offset();
 }
 
 void Viewport::drag_by(const QPoint &delta)
@@ -87,6 +88,8 @@ void Viewport::drag_by(const QPoint &delta)
 
        view_.set_scale_offset(view_.scale(),
                (*drag_offset_ - delta.x() * view_.scale()));
+
+       view_.set_v_offset(-drag_v_offset_ - delta.y());
 }
 
 void Viewport::drag_release()
index c2c42d155d79bf9ecbe28ed54b2741f37271b554..704e73115514b2183cb4ce058b86bbc9a9000a9d 100644 (file)
@@ -97,6 +97,7 @@ private:
 
 private:
        boost::optional<pv::util::Timestamp> drag_offset_;
+       int drag_v_offset_;
 
        double pinch_offset0_;
        double pinch_offset1_;