From 61205f5e5558dd06932e101d85072ff6e87df9b7 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 10 Jun 2021 20:51:35 -0400 Subject: [PATCH] lvgui: Add point_scale Will be used for fonts --- boot/lib/lvgui/lvgui/__init.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boot/lib/lvgui/lvgui/__init.rb b/boot/lib/lvgui/lvgui/__init.rb index 4960db07..d1dfe5e7 100644 --- a/boot/lib/lvgui/lvgui/__init.rb +++ b/boot/lib/lvgui/lvgui/__init.rb @@ -12,6 +12,11 @@ module LVGUI (dpi * x/200).to_i end + def self.point_scale(x) + dpi = LVGL::Hacks.dpi() + (dpi * x/200*4/3).to_i + end + def self.col_padding() pixel_scale(32) end