Sign in to follow this  

Clipping problem (SDL)

This topic is 4559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites

This topic is 4559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this