From a19661ca90f5546b96744221d715c9ba41cfad42 Mon Sep 17 00:00:00 2001 From: Jordan Ruthe Date: Mon, 22 Feb 2021 10:36:33 -0500 Subject: [PATCH] gtk: fix font ratio for insanely wide screens --- ks_includes/KlippyGtk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index cf518695..6e4512dc 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -9,7 +9,7 @@ klipperscreendir = os.getcwd() class KlippyGtk: labels = {} - font_ratio = 51 + font_ratio = [51, 30] width_ratio = 16 height_ratio = 9.375 @@ -17,7 +17,10 @@ class KlippyGtk: self.width = width self.height = height - self.font_size = int(round(self.width / self.font_ratio)) + self.font_size = int(min( + self.width / self.font_ratio[0], + self.height / self.font_ratio[1] + )) self.header_size = int(round((self.width / self.width_ratio) / 1.33)) self.img_width = int(round(self.width / self.width_ratio)) self.img_height = int(round(self.height / self.height_ratio))