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
This commit is contained in:
@@ -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;
|
package com.threerings.media;
|
||||||
|
|
||||||
@@ -259,16 +259,16 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
|
|
||||||
int width = getWidth(), height = getHeight();
|
int width = getWidth(), height = getHeight();
|
||||||
int nx = _vbounds.x, ny = _vbounds.y;
|
int nx = _vbounds.x, ny = _vbounds.y;
|
||||||
Rectangle bounds = _fpath.getBounds();
|
|
||||||
|
|
||||||
// figure out where to move
|
// figure out where to move
|
||||||
switch (_fmode) {
|
switch (_fmode) {
|
||||||
case CENTER_ON_PATHABLE:
|
case CENTER_ON_PATHABLE:
|
||||||
nx = bounds.x + (bounds.width - width)/2;
|
nx = _fpath.getX() - width/2;
|
||||||
ny = bounds.y + (bounds.height - height)/2;
|
ny = _fpath.getY() - height/2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENCLOSE_PATHABLE:
|
case ENCLOSE_PATHABLE:
|
||||||
|
Rectangle bounds = _fpath.getBounds();
|
||||||
if (nx > bounds.x) {
|
if (nx > bounds.x) {
|
||||||
nx = bounds.x;
|
nx = bounds.x;
|
||||||
} else if (nx + width < bounds.x + bounds.width) {
|
} else if (nx + width < bounds.x + bounds.width) {
|
||||||
|
|||||||
Reference in New Issue
Block a user