From 21181e8ba35c782bbcd61fd2bfce2f088a798597 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 27 Jan 2006 03:28:04 +0000 Subject: [PATCH] Don't dirty our bounds if setLocation() is called with our current location. This could possibly break something that depended on the old behavior, so we'll have to watch for broken things and make them right. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3822 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/animation/Animation.java | 4 ++++ src/java/com/threerings/media/sprite/Sprite.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/java/com/threerings/media/animation/Animation.java b/src/java/com/threerings/media/animation/Animation.java index 6598a04bb..1f93ab9d4 100644 --- a/src/java/com/threerings/media/animation/Animation.java +++ b/src/java/com/threerings/media/animation/Animation.java @@ -65,6 +65,10 @@ public abstract class Animation extends AbstractMedia // documentation inherited public void setLocation (int x, int y) { + if (_bounds.x == x && _bounds.y == y) { + return; // no-op + } + // start with our current bounds Rectangle dirty = new Rectangle(_bounds); diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java index 148c2fd1d..d237daf13 100644 --- a/src/java/com/threerings/media/sprite/Sprite.java +++ b/src/java/com/threerings/media/sprite/Sprite.java @@ -150,6 +150,10 @@ public abstract class Sprite extends AbstractMedia // documentation inherited public void setLocation (int x, int y) { + if (x == _ox && y == _oy) { + return; // no-op + } + // start with our current bounds Rectangle dirty = new Rectangle(_bounds);