make sure to paint the first frame when starting an animation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1705 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: MultiFrameAnimation.java,v 1.2 2002/09/17 21:58:12 ray Exp $
|
||||
// $Id: MultiFrameAnimation.java,v 1.3 2002/09/17 22:06:26 ray Exp $
|
||||
|
||||
package com.threerings.media.animation;
|
||||
|
||||
@@ -61,8 +61,8 @@ public class MultiFrameAnimation extends Animation
|
||||
{
|
||||
super.reset();
|
||||
|
||||
// reset ourselves to frame zero
|
||||
setFrameIndex(0);
|
||||
// reset ourselves to a frame number that indicates that we're starting
|
||||
setFrameIndex(-1);
|
||||
|
||||
// reset our frame sequencer
|
||||
_seeker.init(_frames);
|
||||
@@ -90,14 +90,15 @@ public class MultiFrameAnimation extends Animation
|
||||
protected void setFrameIndex (int fidx)
|
||||
{
|
||||
_fidx = fidx;
|
||||
_bounds.width = _frames.getWidth(_fidx);
|
||||
_bounds.height = _frames.getHeight(_fidx);
|
||||
int frame = Math.max(0, _fidx);
|
||||
_bounds.width = _frames.getWidth(frame);
|
||||
_bounds.height = _frames.getHeight(frame);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void paint (Graphics2D gfx)
|
||||
{
|
||||
_frames.paintFrame(gfx, _fidx, _bounds.x, _bounds.y);
|
||||
_frames.paintFrame(gfx, Math.max(0, _fidx), _bounds.x, _bounds.y);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
|
||||
Reference in New Issue
Block a user