Slick Forums

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

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: TextureAreaBase bug?
PostPosted: Mon Sep 03, 2012 11:59 am 
Offline

Joined: Sat Aug 20, 2011 3:39 pm
Posts: 20
It says in the code // negative size allows for flipping
Which is a welcome feature. My problem is when I do use a negative height the texture is not only flipped but also shifted one pixel.

Looking at the TextureAreaBase constuctor:

Code:
    54         if(width == 1) {
    55             fx += 0.5f;
    56             width = 0;
    57         } else if(width < -1) {
    58             fx -= width + 1;
    59         }
    60         if(height == 1) {
    61             fy += 0.5f;
    62             height = 0;
    63         } else if(height < -1) {
    64             fy -= height + 1;
    65         }


I ask myself why do you shift fx and fy one pixel when using negative values?
Changing line 64 to fy -= height; gives me expected result.

Is there some reason +1 are added to fx and fy?


Top
 Profile  
 
 Post subject: Re: TextureAreaBase bug?
PostPosted: Mon Sep 03, 2012 5:26 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1173
Thanks, I fixed it.

_________________
TWL - The Themable Widget Library


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:  
cron
Powered by phpBB® Forum Software © phpBB Group