Scrolling horizontally, regardless if through the tilt wheel, dragging the
signals, or moving the scroll bar, updates the viewport and the scroll bar. This
triggered a valueChanged() signal from the scroll bar, causing the viewport to
be updated again (redundantly). The operation of the viewport became dependent
on the scroll bar. On high zoom levels, where the scroll bar's resolution is
limited, the coupling manifested as jitter. The view was rendered with the
proper resolution of, caused the mouse drag event, then immediately updated and
rendered with the limited resolution of the scroll bar.
Decouple the viewport from the valueChanged() signal, and use the sliderMoved()
signal instead. The scroll bar becomes a simple input element, and only causes
a viewport update when acted upon by the user. Using the scroll bar is still
limited in resolution, but other scrolling methods are no longer affected by the
limitations of the scroll bar.
This fixes bug 7.
Signed-off-by: Alexandru Gagniuc <redacted>
Cursor(*this, 1.0))),
_hover_point(-1, -1)
{
- connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
- this, SLOT(h_scroll_value_changed(int)));
+ connect(horizontalScrollBar(), SIGNAL(sliderMoved(int)),
+ this, SLOT(h_scroll_moved(int)));
connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(v_scroll_value_changed(int)));
update_scroll();
}
-void View::h_scroll_value_changed(int value)
+void View::h_scroll_moved(int value)
{
const int range = horizontalScrollBar()->maximum();
if (range < MaxScrollValue)
private slots:
- void h_scroll_value_changed(int value);
+ void h_scroll_moved(int value);
void v_scroll_value_changed(int value);
void signals_changed();