We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3366 - SDL_RenderCopy shifts negative coordinates
Summary: SDL_RenderCopy shifts negative coordinates
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-19 10:49 UTC by Igor S.
Modified: 2017-08-15 18:11 UTC (History)
0 users

See Also:


Attachments
Example (1.80 MB, application/zip)
2016-06-19 10:49 UTC, Igor S.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor S. 2016-06-19 10:49:23 UTC
Created attachment 2500 [details]
Example

SDL_RenderCopy is shifting dstrect coordinates when negative.

See attached example
Please forgive my coding style :-)
Comment 1 Sam Lantinga 2017-08-12 02:13:48 UTC
Can you try with the latest Mercurial?
http://www.libsdl.org/tmp/SDL-2.0.zip

I'm seeing the background image float in a figure eight pattern, clipped by the window. Is that the correct behavior?
Comment 2 Igor S. 2017-08-12 12:28:36 UTC
Happens for me with the newly built DLL too.
Yes, 8-figure is correct, but when a sprite crosses the left or top edge of window, its coordinates are negative and seem to be rounded in the opposite direction of when they are positive.
Visually it's seen as one-pixel jerk at the moment of touching the window border.
Comment 3 Igor S. 2017-08-15 12:44:13 UTC
Just realized in this old test project the rounding happens at my side, and SDL_RenderCopy only takes integers.
So not a bug in SDL.
Comment 4 Sam Lantinga 2017-08-15 18:11:08 UTC
Great, I'm glad you figured it out. :)