# SDL: PSP: SDL\_RenderCopyEx rotation and global scaling around the wrong way (see #bug 3070)

**URL:** <https://discourse.libsdl.org/t/sdl-psp-sdl-rendercopyex-rotation-and-global-scaling-around-the-wrong-way-see-bug-3070/34819>\
**Category:** SDL Commits\
**Created:** [February 15, 2022, 10:36am UTC](https://discourse.libsdl.org/t/sdl-psp-sdl-rendercopyex-rotation-and-global-scaling-around-the-wrong-way-see-bug-3070/34819 "2022-02-15T10:36:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [February 15, 2022, 10:36am UTC](https://discourse.libsdl.org/t/sdl-psp-sdl-rendercopyex-rotation-and-global-scaling-around-the-wrong-way-see-bug-3070/34819/1 "2022-02-15T10:36:07Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/61abc4e5b64c390d7c7c1ff25fa0e2b755fc34eb>

```diff
From 61abc4e5b64c390d7c7c1ff25fa0e2b755fc34eb Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Tue, 15 Feb 2022 11:34:50 +0100
Subject: [PATCH] PSP: SDL_RenderCopyEx rotation and global scaling around the
 wrong way (see #bug 3070)

---
 src/render/psp/SDL_render_psp.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c
index 904fb2c0879..cdc0b915674 100644
--- a/src/render/psp/SDL_render_psp.c
+++ b/src/render/psp/SDL_render_psp.c
@@ -881,7 +881,7 @@ PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * tex
 static int
 PSP_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture,
                const SDL_Rect * srcrect, const SDL_FRect * dstrect,
- const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
+ const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y)
 {
     VertTV *verts = (VertTV *) SDL_AllocateRenderVertices(renderer, 4 * sizeof (VertTV), 4, &cmd->data.draw.first);
     const float centerx = center->x;
@@ -949,7 +949,20 @@ PSP_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * t
     verts->x = x + cw2 + sh1;
     verts->y = y - sw2 + ch1;
     verts->z = 0;
- verts++;
+
+ if (scale_x != 1.0f || scale_y != 1.0f) {
+ verts->x *= scale_x;
+ verts->y *= scale_y;
+ verts--;
+ verts->x *= scale_x;
+ verts->y *= scale_y;
+ verts--;
+ verts->x *= scale_x;
+ verts->y *= scale_y;
+ verts--;
+ verts->x *= scale_x;
+ verts->y *= scale_y;
+ }
 
     return 0;
 }

```
