PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

small surfaces lose bits on blit - bug ?

I have various small Sprites for radio buttons & check boxes etc and have noticed that the images all lose the right hand pixel column and the bottom pixel row so a 20 x 20 image only displays 19 x 19.

I have worked around this just by adding an extra blank pixel to the side & bottom.

The bug continues up to 31 x 31 but 32 x 32 sprites are fine.
That is surprising... I can't think of anything that would explain the problem for sprites with size < 32...

How do you display your sprites? It seems to me that you might be specifying a wrong source rectangle. If your sprite is located at 32,32 on a surface and it's size is 16,16, then you should use a source rectangle of (32,32,48,48). Not (32,32,47,47). That could explain your missing pixels.

Rectangle in windows always exclude the last row and column, so I kept the convention in PocketFrog.