Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 1:50 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Sep 27, 2009 3:23 pm 
Offline

Joined: Sat Aug 22, 2009 9:25 am
Posts: 4
Hi !
I'm experiencing a strange phenomenon, maybe a bug.
Code:
public void render(GameContainer container, Graphics g){
g.drawLine(500, 0, 500,500);
}

=> OK : This code works. A vertical line is drawn as expected.

Code:
public void render(GameContainer container, Graphics g){
g.pushTransform();
g.scale(2f, 2f);
g.popTransform();
g.drawLine(500, 0, 500,500);
}

=> KO : This code doesn't look to work. The vertical line is not displayed which is unexpected. The code behave as if I had set the line width to .5.

Calling g.setLineWidth(2) bypass the issue. It looks like there is a trick made by scale(2f,2f) that is not roll-backed by popTransform. I tried to call g.resetLineWidth(), but is doesn't help at all: the lien is still not drawn.

This code draws a strong line.
Code:
public void render(GameContainer container, Graphics g){
g.pushTransform();
g.scale(.2f, .2f);
g.popTransform();
g.drawLine(500, 0, 500,500);
}

=> KO: A strong line is drawn rather than a normal line.

Is there a bypass ? Thanks for all !


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

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Ooooh, great find. Was losing the scaling factors with push/pop.

Fixed in SVN. Thanks!

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: Google [Bot] 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