Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • B bjgf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 127
    • Issues 127
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • BlueJ
  • bjgf
  • Issues
  • #1373
Closed
Open
Issue created Jul 26, 2007 by Michael Kölling@mikMaintainer

[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
Assignee
Assign to
Time tracking