diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index ecb13c2..3139795 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -568,9 +568,11 @@ async def build_grid(session_id: str): for zg in content_zones ) - # Only apply union if it found more columns than - # any single zone (union adds information) - if total_cols > max_zone_cols: + # Apply union whenever it has at least as many + # columns as the best single zone. Even with the + # same count the union boundaries are better because + # they incorporate evidence from all zones. + if total_cols >= max_zone_cols: cx_min = min(w["left"] for w in all_words) cx_max = max( w["left"] + w["width"] for w in all_words