Added a function to scale the font size according to preferences.

The scale will be calculated in relation to the system dpi and Blender's interface resolution scale.
This commit is contained in:
Bruno Perdigão
2024-09-05 14:12:59 -03:00
parent f521945766
commit 214c278fc5
+9
View File
@@ -1155,3 +1155,12 @@ class Blender(bonsai.core.tool.Blender):
pass
return sun_position
@classmethod
def scale_font_size(cls, size):
default_dpi = 72
default_pixel_size = 1.0
default_scale = (default_dpi * default_pixel_size)
system = bpy.context.preferences.system
system_scale = (system.dpi * system.pixel_size)
return (system_scale / default_scale) * size