diff --git a/src/java/com/threerings/miso/client/IsoSceneViewModel.java b/src/java/com/threerings/miso/client/IsoSceneViewModel.java index 7d570e56b..56e81cc26 100644 --- a/src/java/com/threerings/miso/client/IsoSceneViewModel.java +++ b/src/java/com/threerings/miso/client/IsoSceneViewModel.java @@ -1,5 +1,5 @@ // -// $Id: IsoSceneViewModel.java,v 1.25 2002/06/17 18:01:47 shaper Exp $ +// $Id: IsoSceneViewModel.java,v 1.26 2002/06/21 00:04:41 mdb Exp $ package com.threerings.miso.scene; @@ -37,6 +37,10 @@ public class IsoSceneViewModel /** Size of the view in tile count. */ public int scenevwid, scenevhei; + /** Whether or not this view can extend beyond the bounds defined by + * the view width and height. True if it cannot, false if it can. */ + public boolean bounded = true; + /** The bounds of the view in screen pixel coordinates. */ public Rectangle bounds; diff --git a/src/java/com/threerings/miso/client/SceneViewPanel.java b/src/java/com/threerings/miso/client/SceneViewPanel.java index 3293c7b69..864bb6f75 100644 --- a/src/java/com/threerings/miso/client/SceneViewPanel.java +++ b/src/java/com/threerings/miso/client/SceneViewPanel.java @@ -1,5 +1,5 @@ // -// $Id: SceneViewPanel.java,v 1.42 2002/06/20 07:50:33 mdb Exp $ +// $Id: SceneViewPanel.java,v 1.43 2002/06/21 00:04:41 mdb Exp $ package com.threerings.miso.scene; @@ -143,15 +143,16 @@ public class SceneViewPanel extends VirtualMediaPanel // documentation inherited public void setViewLocation (int x, int y) { - // make sure no one tries to set our view location outside the - // bounds defined by the view model - int minx = _viewmodel.bounds.x, - maxx = _viewmodel.bounds.width-getWidth(); - int miny = _viewmodel.bounds.y, - maxy = _viewmodel.bounds.height-getHeight(); - if (x < minx) { x = minx; } else if (x > maxx) { x = maxx; } - if (y < miny) { y = miny; } else if (y > maxy) { y = maxy; } - + // if we're bounded, make sure no one tries to set our view + // location outside the bounds defined by the view model + if (_viewmodel.bounded) { + int minx = _viewmodel.bounds.x, + maxx = _viewmodel.bounds.width-getWidth(); + int miny = _viewmodel.bounds.y, + maxy = _viewmodel.bounds.height-getHeight(); + if (x < minx) { x = minx; } else if (x > maxx) { x = maxx; } + if (y < miny) { y = miny; } else if (y > maxy) { y = maxy; } + } super.setViewLocation(x, y); }