Author Topic: blit inaccuracy  (Read 719 times)

Offline IZACIZAC

  • byte
  • *
  • Posts: 19
    • View Profile
blit inaccuracy
« on: May 31, 2013, 11:27:59 pm »
Hey, I am blitting a portion of a texture (1024x256)

Code: [Select]
buffer.blit(ui,0,0,0,0,600,25,true);
Which is working fine, but when I resize the window

Code: [Select]
if (Display.wasResized())
            {
                buffer.resize(Display.getWidth(), Display.getHeight());
            }

It no longer draws the portion that I want, and instead draws 1 extra pixels worth (so 26 instead of 25) and shrinks it to fill the 25 pixel space (baiscally it has a big white line under it on screen). It also shifts the entire drawing down by 1, so draws at 1 instead of 0 (both in Y and X). This is only when the Display is a odd number in height/width e.g. 801x601

Is this normal/what should I do to avoid this?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: blit inaccuracy
« Reply #1 on: May 31, 2013, 11:32:11 pm »
Have you tried the latest beta to see if it fixes this problem: http://jpct.de/download/beta/jpct.jar?

Offline IZACIZAC

  • byte
  • *
  • Posts: 19
    • View Profile
Re: blit inaccuracy
« Reply #2 on: June 01, 2013, 12:06:42 am »
Perfect. Thanks for the quick reply, prob solved