From 250574bc41a5e60b7362bb88bd545f41e5c76c62 Mon Sep 17 00:00:00 2001 From: alfrix Date: Mon, 5 Dec 2022 09:07:28 -0300 Subject: [PATCH] bedmap: limit probed position display to 16x8 --- ks_includes/widgets/bedmap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ks_includes/widgets/bedmap.py b/ks_includes/widgets/bedmap.py index bbc7ef19..b1dffac7 100644 --- a/ks_includes/widgets/bedmap.py +++ b/ks_includes/widgets/bedmap.py @@ -48,9 +48,14 @@ class BedMap(Gtk.DrawingArea): ctx.close_path() ctx.fill() ctx.stroke() + if rows > 16 or columns > 8: + continue # Numbers ctx.set_source_rgb(0, 0, 0) - ctx.move_to((lx + rx) / 2 - self.font_size, (ty + by + self.font_size) / 2) + if column > 0: + ctx.move_to((lx + rx) / 2 - self.font_size, (ty + by + self.font_size) / 2) + else: + ctx.move_to((lx + rx) / 2 - self.font_size * 1.2, (ty + by + self.font_size) / 2) ctx.show_text(f"{column:.2f}") ctx.stroke()