mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 22:53:23 +00:00
Fixed destination coordinates when using scale with the software renderer
Fixes https://github.com/libsdl-org/SDL/issues/14051
This commit is contained in:
parent
b7b2e8bc31
commit
d333044462
1 changed files with 5 additions and 3 deletions
|
|
@ -924,9 +924,11 @@ static bool SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
|
|||
PrepTextureForCopy(cmd, &drawstate);
|
||||
|
||||
// Apply viewport
|
||||
if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) {
|
||||
copydata->dstrect.x += drawstate.viewport->x;
|
||||
copydata->dstrect.y += drawstate.viewport->y;
|
||||
if (drawstate.viewport &&
|
||||
(drawstate.viewport->x || drawstate.viewport->y) &&
|
||||
(copydata->scale_x > 0.0f && copydata->scale_y > 0.0f)) {
|
||||
copydata->dstrect.x += drawstate.viewport->x / copydata->scale_x;
|
||||
copydata->dstrect.y += drawstate.viewport->y / copydata->scale_y;
|
||||
}
|
||||
|
||||
SW_RenderCopyEx(renderer, surface, cmd->data.draw.texture, ©data->srcrect,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue