Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 19, 2013 5:22 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Sep 06, 2008 3:02 pm 
Offline

Joined: Wed Aug 27, 2008 4:20 pm
Posts: 7
I've found a small but annoying bug. Occasionally, when trying to apply a Transform to a Line object, I get a NullPointerException because the points array is null for some reason. There is an easy way to fix this; simply change the following method:

Code:
public Shape transform(Transform transform) {
      float[] temp = new float[4];
      transform.transform(points, 0, temp, 0, 2);
      
      return new Line(temp[0],temp[1],temp[2],temp[3]);
   }


...to this:

Code:
public Shape transform(Transform transform) {
      float[] temp = new float[4];
      createPoints(); // <-- Inserted line
      transform.transform(points, 0, temp, 0, 2);
      
      return new Line(temp[0],temp[1],temp[2],temp[3]);
   }


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 5:29 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
All bugs are annoying.

In SVN.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group