From d556c79088a16eee4d4dada9841cb701ee84b9d7 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sun, 2 Oct 2005 01:27:24 +0000 Subject: [PATCH] Removed the optimization of not recalculating the hover sprite when we were still over a hover sprite as that prevents things from working properly if hover sprites overlap. This isn't much of a tradeoff as most of the time the mouse is not over a hover sprite in which case it does the full hit testing anyway. Also fixed a bug wherein the active sprite was not actually configured unless it implemented HoverSprite which the rest of the code takes pains not to require (it should be and is now possible to have action sprites that do not implement HoverSprite but still work). By the way, this whole action/hover/etc. sprite business is goddamned handy. It's *so* much nicer than having to implement mouse listeners and do a bunch of crap by hand. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3717 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/MediaPanel.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/media/MediaPanel.java b/src/java/com/threerings/media/MediaPanel.java index 8de620929..a4533b28a 100644 --- a/src/java/com/threerings/media/MediaPanel.java +++ b/src/java/com/threerings/media/MediaPanel.java @@ -710,13 +710,11 @@ public class MediaPanel extends JComponent } } - if (_activeSprite == null) { - Sprite s = getHit(me); - if (s instanceof HoverSprite) { - ((HoverSprite) s).setHovered(true); - _activeSprite = s; - } + Sprite s = getHit(me); + if (s instanceof HoverSprite) { + ((HoverSprite) s).setHovered(true); } + _activeSprite = s; } /**