From 8f0ec222673cac65fd84ee7e0d3b96123d73031d Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 24 Jun 2003 18:02:58 +0000 Subject: [PATCH] Undid my last revision; the X/Y coordinates of a pathable are actually the hotspot, which does not need to be the upper left coordinate. So we let the sprite do the right thing and we just center on the hotspot. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2681 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/VirtualMediaPanel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/media/VirtualMediaPanel.java b/src/java/com/threerings/media/VirtualMediaPanel.java index 7e38467b6..a8c3bb263 100644 --- a/src/java/com/threerings/media/VirtualMediaPanel.java +++ b/src/java/com/threerings/media/VirtualMediaPanel.java @@ -1,5 +1,5 @@ // -// $Id: VirtualMediaPanel.java,v 1.21 2003/06/24 02:24:54 ray Exp $ +// $Id: VirtualMediaPanel.java,v 1.22 2003/06/24 18:02:58 ray Exp $ package com.threerings.media; @@ -259,16 +259,16 @@ public class VirtualMediaPanel extends MediaPanel int width = getWidth(), height = getHeight(); int nx = _vbounds.x, ny = _vbounds.y; - Rectangle bounds = _fpath.getBounds(); // figure out where to move switch (_fmode) { case CENTER_ON_PATHABLE: - nx = bounds.x + (bounds.width - width)/2; - ny = bounds.y + (bounds.height - height)/2; + nx = _fpath.getX() - width/2; + ny = _fpath.getY() - height/2; break; case ENCLOSE_PATHABLE: + Rectangle bounds = _fpath.getBounds(); if (nx > bounds.x) { nx = bounds.x; } else if (nx + width < bounds.x + bounds.width) {