static: Use centroid as position

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2026-05-06 12:32:24 +02:00
parent 516f6874a6
commit 9cb5fc6428
1 changed files with 2 additions and 2 deletions

View File

@ -660,8 +660,8 @@ class StaticPlacer
height = bin_h;
}
double x0 = pos.x, x1 = pos.x + width;
double y0 = pos.y, y1 = pos.y + height;
double x0 = pos.x - width / 2.f, x1 = pos.x + width / 2.f;
double y0 = pos.y - height / 2.f, y1 = pos.y + height / 2.f;
for (int y = int(y0 / bin_h); y <= int(y1 / bin_h); y++) {
for (int x = int(x0 / bin_w); x <= int(x1 / bin_w); x++) {
if (x < 0 || x >= m || y < 0 || y >= m)