| Summary: | SDL_RenderCopyEx rotation center not well-defined (please support float) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | xyzdragon |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | xyzdragon |
| Version: | 2.0.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
A simple test to determine how the rotation center is interpreted
Rendering of the test on my system |
||
Created attachment 2632 [details]
Rendering of the test on my system
|
Created attachment 2631 [details] A simple test to determine how the rotation center is interpreted I find the rotation center very ambiguous, because it only accepts integer coordinates. But what do they mean? top left corner of a pixel cell, or the center of a pixel cell? The latter makes more sense when talking about integer coordinates, but the top left corners makes more sense in a float context. Therefore it seems to me, that the backend used by SDL actually allows float coordinates, but SDL artificially restricts this to integer. This leads to unexpected behavior. E.g. rotating a 1x1 texture around itself (rotation center = NULL, i.e. same as texture coordinates) and rendering that 1px texture with 0,90,180,270 degrees rotation will lead to 4 pixels being drawn, because the pixel is not rotated around it's center, but it's top left corner. See attachment for a simple test. The tests only behave as expected for textures with even width and height.