[GREENFOOT-91] Can't draw on GreenfootImages after using mirror/scale/rotate on the image
Here is an Actor which is showing the behaviour. The rectangle should keep growing and changing each frame. When you click on it, it will flip it's image, and the draw it's doing each frame no longer works.
import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot) import java.awt.Color;
public class TestActor extends Actor
{
private int rectHeight = 0;
public void act()
{
getImage().clear();
getImage().setColor(Color.BLUE);
// draw a rectangle over the left side of the actors imge
getImage().fillRect(
0, 0,
getImage().getWidth()/2,
rectHeight % getImage().getHeight());
rectHeight++;
if (Greenfoot.mousePressed(this)) {
getImage().mirrorHorizontally();
}
}
}
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 1.4.0