Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 3:19 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 06, 2009 2:40 pm 
Offline

Joined: Thu Nov 05, 2009 3:38 pm
Posts: 21
Hi,

I think I've found a bug in the svg inkscape loading.

In RectProcessor.process(), PolygonProcessor.process(), LineProcessor.process() methods the inherited transform object is concatenated with the current transform in the wrong order.

Current code in these three methods:

Code:
   public void process(Loader loader, Element element, Diagram diagram, Transform t) throws ParsingException {
      Transform transform = Util.getTransform(element);
      transform = new Transform(transform, t);


But imho it must be like this:

Code:
   public void process(Loader loader, Element element, Diagram diagram, Transform t) throws ParsingException {
      Transform transform = Util.getTransform(element);
      transform = new Transform(t, transform);


It's just a little difference, but with big outcome. The position of rects, polygons and lines is not calculated right.

You can test it with following svg file I've uploaded:

http://iluzio.de/download/slick_test.svg

In inkscape (or firefox) the four green rects are completely inside the blue rect, with slick they are rendered at the border of the blue rect. With the fix from above everything is alright again...


kind regards!
shadow


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 23, 2009 8:34 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Cheers, commited 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 2 guests


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