shithub: sce

Download patch

ref: f65f1bb7adbcd97e8738d15c37903338d8885570
parent: 20d8b5ebe502140d2643f36581bd64b795dcfe01
author: qwx <qwx@sciops.net>
date: Thu Apr 1 03:39:46 EDT 2021

drw: fix window fix wrt scaling

scale doesn't enter into this: an object overlapping a
single pixel at the top left corner can still be tiles
away.

--- a/drw.c
+++ b/drw.c
@@ -365,6 +365,7 @@
 static Rectangle
 setdrawrect(void)
 {
+	int f;
 	Rectangle r;
 
 	r.min.x = pan.x / scale / Tilewidth;
@@ -379,8 +380,8 @@
 		r.max.y = mapheight;
 	/* enlarge window to capture units overlapping multiple tiles;
 	 * seems like the easiest way to take this into account */
-	r.min.x = max(r.min.x - 4 / scale, 0);
-	r.min.y = max(r.min.y - 4 / scale, 0);
+	r.min.x = max(r.min.x - 4, 0);
+	r.min.y = max(r.min.y - 4, 0);
 	return r;
 }