[GREENFOOT-29] Object's getWidth and getHeight should work without world
If an objects has not yet been added to a world the getWidth and gethHeight methods does not work.
This should be changed so that if a world is instantiated, it should ask for the cell size of that world. If a world does not exist it should throw an expception (which should not be possible to get!)
------- Comment GREENFOOT-1 From Poul Henriksen 2006-04-21 15:33:27 [reply] ------- after fixing bug 1064 it will be possible to get the exception.
------- Comment GREENFOOT-2 From Poul Henriksen 2006-05-11 15:18:47 [reply] ------- Verified for version 0.9
------- Comment GREENFOOT-3 From Poul Henriksen 2007-01-30 17:11:13 [reply] ------- If getWidth() and getHeight() are called in the constructor of the actor an exception is thrown: java.lang.IllegalStateException: No world has been instantiated. at greenfoot.Actor.getPaintX(Actor.java:520) at greenfoot.Actor.getXMax(Actor.java:481) at greenfoot.Actor.getWidth(Actor.java:150) at Rocket.(Rocket.java:16) at Space.createRocketAndSpeeder(Space.java:21) at Space.(Space.java:17)
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 1.3.0