origin now relative to dest size
parent
62b4515585
commit
ce4638d1e9
|
@ -81,7 +81,7 @@ void _exec_sprite_cmd(const drawcmd_t* cmd) {
|
|||
const sprite_t* sprite = &cmd->sprite;
|
||||
SDL_FRect untransformed = {sprite->x, sprite->y, sprite->sx, sprite->sy};
|
||||
SDL_FRect destrect = get_dest_with_size(untransformed, cmd->ui);
|
||||
SDL_FPoint origin = {sprite->uv.w * sprite->origin.x, sprite->uv.h * sprite->origin.y};
|
||||
SDL_FPoint origin = {destrect.w * sprite->origin.x, destrect.h * sprite->origin.y};
|
||||
SDL_RenderCopyExF(g_context.renderer, sprite->texture,
|
||||
&sprite->uv, &destrect, sprite->rot,
|
||||
&origin, SDL_FLIP_NONE);
|
||||
|
|
Loading…
Reference in New Issue