Clipping problem (SDL)

Started by
1 comment, last by Feidias 18 years, 10 months ago
I have a manual clipping which doesn't match with SDL rectangle clipping. This problem is driving me nuts.. The error is only when clipping left or upper sides. I'm using if (x<0) { w+=x; x=0; } for the manual clipping. The picture shows what happens if the cursor is outside the tile. It's one pixel "late" than the actual pixel. When the cursor is totally visible everything works ok. Image What I'm trying to do here is a precise cursor for a brush in sprite editor.
Advertisement
What is wrong with using if (x<0) { w+=x+1; x=0; } .
Quote:Original post by Easca
What is wrong with using if (x<0) { w+=x+1; x=0; } .


Well, that doesn't make any sense. I think the manual clipping works exactly as it should, it's just something with the precise cursor I'm doing wrong. Actually, if I make the mouse cursor "jump" forward one pixel when x<0 then it works. But it's not the proper solution, because you can see how the cursor jumps and it makes you wonder what just happened..

This topic is closed to new replies.

Advertisement