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 4390 - SDL_RenderCopyEx rotation and global scaling around the wrong way
Summary: SDL_RenderCopyEx rotation and global scaling around the wrong way
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.9
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-19 01:14 UTC by Anthony @ POW Games
Modified: 2018-11-20 12:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony @ POW Games 2018-11-19 01:14:21 UTC
This should be an easy fix. Simply apply global scale factor after rotating verts?

The problem is when using SDL_RenderSetScale with non-equal width and height. This scale factor is applied before rotation. I can't think of any situation where this is the desired result. It means the rotated shape is distorted. Say you have a square texture, and scale factor of 1, .5, the square will be squashed and rotated, rather than rotated, then squashed in unison with all the other non-rotated shapes.
Comment 1 Anthony @ POW Games 2018-11-19 13:16:05 UTC
After briefly looking at the source code, I can see there is no simple fix for this. Scaling is done before the angle is passed down deeper into the renderer's QueueCopyEx(). 

Scaling would need to be passed down deeper into the renderer queue and applied there.

This is still a bug though. It's caused me many problems that I've had to find a messy work-around for in most of my designs.