From d323c25ed44ab43a99279b8884474d5cac4dacf8 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Wed, 17 May 2023 20:59:50 -0400 Subject: [PATCH] Add debug markers for grid bounds (min/max) --- src/textual_paint/paint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/textual_paint/paint.py b/src/textual_paint/paint.py index 90a0865..9b115ae 100755 --- a/src/textual_paint/paint.py +++ b/src/textual_paint/paint.py @@ -1265,6 +1265,8 @@ class AnsiArtDocument: min_y = min(float(rect.attrib["y"]) for rect in rects) max_x = max(float(rect.attrib["x"]) + float(rect.attrib["width"]) for rect in rects) max_y = max(float(rect.attrib["y"]) + float(rect.attrib["height"]) for rect in rects) + add_debug_marker(min_x, min_y, "blue") + add_debug_marker(max_x, max_y, "blue") width = int((max_x - min_x) / cell_width) height = int((max_y - min_y) / cell_height) # Adjust cell width/height based on document bounds.