summaryrefslogtreecommitdiff
path: root/libs/canvas/scroll_group.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-05-21 19:13:26 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-03 16:10:27 -0400
commit22e72527294a0de6b93c7a4028f485d9b59552f6 (patch)
tree454374c4e5f778012a4ec5162c97a5c5afe4378b /libs/canvas/scroll_group.cc
parent5696199daffbd40e82aa7f0a754e36b2adf6726e (diff)
inline ScrollGroup::canvas_position() for no particular reason
Diffstat (limited to 'libs/canvas/scroll_group.cc')
-rw-r--r--libs/canvas/scroll_group.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/libs/canvas/scroll_group.cc b/libs/canvas/scroll_group.cc
index bda6911ca7..94ea869971 100644
--- a/libs/canvas/scroll_group.cc
+++ b/libs/canvas/scroll_group.cc
@@ -37,27 +37,26 @@ ScrollGroup::ScrollGroup (Group* parent, Duple position, ScrollSensitivity s)
void
ScrollGroup::scroll_to (Duple const& d)
{
- Duple base_pos (position().translate (_scroll_offset));
+ /* get the nominal position of the group without scroll being in effect
+ */
+
+ Duple base_pos (_position.translate (_scroll_offset));
+
+ /* compute a new position given our sensitivity to h- and v-scrolling
+ */
if (_scroll_sensitivity & ScrollsHorizontally) {
base_pos.x -= d.x;
_scroll_offset.x = d.x;
- }
+ }
if (_scroll_sensitivity & ScrollsVertically) {
base_pos.y -= d.y;
_scroll_offset.y = d.y;
}
+ /* move there */
+
set_position (base_pos);
}
-Duple
-ScrollGroup::canvas_position() const
-{
- /* return the normal "base" position of this item
- rather its position as affected by any scroll
- offset.
- */
- return _position.translate (_scroll_offset);
-}