1 Commits

Author SHA1 Message Date
q
88dcdf5035 make sure interpolated values within limits 2025-09-23 16:16:25 +03:00

View File

@@ -861,10 +861,10 @@ class World:
w2 = max(1, a[3] / 2) w2 = max(1, a[3] / 2)
h2 = max(1, a[4] / 2) h2 = max(1, a[4] / 2)
return { return {
"x0": int(a[1] - w2), "x0": max(0, int(a[1] - w2)),
"y0": int(a[2] - h2), "y0": max(0, int(a[2] - h2)),
"x1": int(a[1] + w2), "x1": min(self.video_res[0] - 1, int(a[1] + w2)),
"y1": int(a[2] + h2), "y1": min(self.video_res[1] - 1, int(a[2] + h2)),
"type": "interp", "type": "interp",
"visible": visible, "visible": visible,
} }