shithub: sce

Download patch

ref: a4ce29dba46f9d9b36a5fac40317432dfb19c815
parent: 8aace54b35101a9584374ec47822cf55372ec0f9
author: qwx <[email protected]>
date: Thu Mar 12 06:10:46 EDT 2020

drw: fix not taking into account high scaling in boundpic

--- a/drw.c
+++ b/drw.c
@@ -85,12 +85,14 @@
 	if(r->min.x < 0){
 		r->max.x += r->min.x;
 		r->min.x = 0;
-	}else if(r->min.x + r->max.x > fbw / scale)
+	}
+	if(r->min.x + r->max.x > fbw / scale)
 		r->max.x = fbw / scale - r->min.x;
 	if(r->min.y < 0){
 		r->max.y += r->min.y;
 		r->min.y = 0;
-	}else if(r->min.y + r->max.y > fbh)
+	}
+	if(r->min.y + r->max.y > fbh)
 		r->max.y = fbh - r->min.y;
 	r->min.x *= scale;
 	return 0;