summaryrefslogtreecommitdiff
path: root/libs/canvas/canvas.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-09 08:39:38 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-09 08:39:48 -0400
commitf0c18abf55a19c101bd2c4f9bccbe182df060b25 (patch)
tree11f4ba51c11799cb4830a53736201cd987f67947 /libs/canvas/canvas.cc
parent8fe593fccad57f3b21d8beeff9819bb6a636c265 (diff)
remove global canvas scroll offset, to provide no-scroll-parent == no-scroll behaviour
Diffstat (limited to 'libs/canvas/canvas.cc')
-rw-r--r--libs/canvas/canvas.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc
index 7742a9fbf8..100cf7eeaa 100644
--- a/libs/canvas/canvas.cc
+++ b/libs/canvas/canvas.cc
@@ -48,8 +48,6 @@ Canvas::Canvas ()
void
Canvas::scroll_to (Coord x, Coord y)
{
- _scroll_offset = Duple (x, y);
-
/* We do things this way because we do not want to recurse through
the canvas for every scroll. In the presence of large MIDI
tracks this means traversing item lists that include
@@ -61,7 +59,7 @@ Canvas::scroll_to (Coord x, Coord y)
*/
for (list<ScrollGroup*>::iterator i = scrollers.begin(); i != scrollers.end(); ++i) {
- (*i)->scroll_to (_scroll_offset);
+ (*i)->scroll_to (Duple (x, y));
}
pick_current_item (0); // no current mouse position
@@ -225,9 +223,7 @@ Canvas::window_to_canvas (Duple const & d) const
return d.translate (sg->scroll_offset());
}
- /* fallback to global canvas offset ... it would be nice to remove this */
-
- return d.translate (_scroll_offset);
+ return d;
}
Duple
@@ -252,7 +248,7 @@ Canvas::canvas_to_window (Duple const & d, bool rounded) const
if (sg) {
wd = d.translate (-sg->scroll_offset());
} else {
- wd = d.translate (-_scroll_offset);
+ wd = d;
}
/* Note that this intentionally almost always returns integer coordinates */