From 6bff0d778a56ecd42fad627c4b275fde9074ec85 Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Thu, 5 Sep 2002 02:21:54 +0000 Subject: [PATCH] Added getObjectTileBounds() to get the bounds of a particular object in a scene. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1663 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/miso/client/IsoSceneView.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/miso/client/IsoSceneView.java b/src/java/com/threerings/miso/client/IsoSceneView.java index f8f43322c..5bd8c95d6 100644 --- a/src/java/com/threerings/miso/client/IsoSceneView.java +++ b/src/java/com/threerings/miso/client/IsoSceneView.java @@ -1,5 +1,5 @@ // -// $Id: IsoSceneView.java,v 1.117 2002/07/08 21:41:30 mdb Exp $ +// $Id: IsoSceneView.java,v 1.118 2002/09/05 02:21:54 shaper Exp $ package com.threerings.miso.scene; @@ -637,6 +637,22 @@ public class IsoSceneView implements SceneView return _hcoords; } + /** + * Returns the bounds of the given object in the scene in screen + * coordinates, or null if there is no such object. + */ + public Rectangle getObjectTileBounds (int x, int y, ObjectTile tile) + { + Iterator iter = _objects.iterator(); + while (iter.hasNext()) { + ObjectMetrics metrics = (ObjectMetrics)iter.next(); + if (metrics.tile == tile && metrics.x == x && metrics.y == y) { + return metrics.bounds; + } + } + return null; + } + /** * Converts the supplied screen coordinates into tile coordinates, * writing the values into the supplied {@link Point} instance and