From 9cb5fc6428b81738d2636c63bd90c729c93fd918 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 6 May 2026 12:32:24 +0200 Subject: [PATCH] static: Use centroid as position Signed-off-by: gatecat --- common/place/placer_static.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index 234245ca..8229ffdc 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -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)