diff --git a/src/java/com/threerings/media/util/LinePath.java b/src/java/com/threerings/media/util/LinePath.java index 46d4f5834..0d6c89d8e 100644 --- a/src/java/com/threerings/media/util/LinePath.java +++ b/src/java/com/threerings/media/util/LinePath.java @@ -1,5 +1,5 @@ // -// $Id: LinePath.java,v 1.6 2002/06/11 02:39:14 mdb Exp $ +// $Id: LinePath.java,v 1.7 2002/06/12 00:49:15 mdb Exp $ package com.threerings.media.util; @@ -46,12 +46,26 @@ public class LinePath implements Path _duration = duration; } + /** + * Instructs this path to adjust itself when the view scrolls, or not. + * If the path scrolls with the view, it will adjust its starting and + * ending positions by the amount scrolled by the view so that they + * remain fixed relative to the scrolled view. If it doesn't they will + * remain the same regardless of whether the view scrolls. + */ + public void setScrollsWithView (boolean scrollsWithView) + { + _scrollsWithView = scrollsWithView; + } + // documentation inherited from interface public void viewWillScroll (int dx, int dy) { - // adjust our source and destination points - _source.translate(-dx, -dy); - _dest.translate(-dx, -dy); + // adjust our source and dest points if we're tracking the view + if (_scrollsWithView) { + _source.translate(-dx, -dy); + _dest.translate(-dx, -dy); + } } // documentation inherited @@ -139,4 +153,9 @@ public class LinePath implements Path /** The duration that we're to spend following the path. */ protected long _duration; + + /** Whether or not we scroll along with the view (which we accomplish + * by scrolling our start and end positions when the view scrolls) or + * if we should leave our coordinates alone. */ + protected boolean _scrollsWithView = true; }