shithub: npe

Download patch

ref: 36992df80a3a9a05e18b00c4570e043da4352637
parent: 607319bed9f2d7f2ea7ff107ebf51de6c27396d7
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Aug 7 21:06:34 EDT 2023

SDL_RenderCopy: no scaling unless bigger destination

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