Use a safe comparison instead of simple subtraction.
Vilya's ScoreAnimation sets its render order to Integer.MAX_VALUE; using this comparison method gets the AbstractMediaManager's _media out of order when such values are used.
This commit is contained in:
@@ -27,6 +27,8 @@ import java.awt.geom.PathIterator;
|
|||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
|
|
||||||
|
import com.google.common.primitives.Ints;
|
||||||
|
|
||||||
import com.samskivert.util.ObserverList;
|
import com.samskivert.util.ObserverList;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
@@ -164,7 +166,7 @@ public abstract class AbstractMedia
|
|||||||
*/
|
*/
|
||||||
public int renderCompareTo (AbstractMedia other)
|
public int renderCompareTo (AbstractMedia other)
|
||||||
{
|
{
|
||||||
int result = _renderOrder - other._renderOrder;
|
int result = Ints.compare(_renderOrder, other._renderOrder);
|
||||||
return (result != 0) ? result : naturalCompareTo(other);
|
return (result != 0) ? result : naturalCompareTo(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user