shithub: npe

Download patch

ref: 399cee023e21d789febe571d8a5e89ab67a464bf
parent: 31f730351e04573e401681991e266cbe84c332b8
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Mar 15 10:49:57 EDT 2021

SDL_RenderCopy: fall back to memimagedraw if no stretching done

--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -992,7 +992,7 @@
 		backcopy = malloc(logiw*logih*4);
 	}
 
-	if(dre == nil)
+	if(dre == nil && (Dx(sr) != logiw || Dy(sr) != logih))
 		resize((u32int*)byteaddr(t, ZP), Dx(sr), Dy(sr), (u32int*)byteaddr(back, ZP), logiw, logih);
 	else
 		memimagedraw(back, dr, t, sr.min, nil, ZP, S);