mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Update scale_font_size method to accept a None parameter so it is cleaner the calls from the rest of the code base
This commit is contained in:
committed by
Bruno Perdigão
parent
1b784e22af
commit
0be348707c
@@ -466,9 +466,9 @@ class PolylineDecorator:
|
|||||||
|
|
||||||
self.addon_prefs = tool.Blender.get_addon_preferences()
|
self.addon_prefs = tool.Blender.get_addon_preferences()
|
||||||
self.font_id = 0
|
self.font_id = 0
|
||||||
font_size = tool.Blender.scale_font_size(None)
|
font_size = tool.Blender.scale_font_size()
|
||||||
offset = tool.Blender.scale_font_size(None) * 1.5
|
offset = tool.Blender.scale_font_size() * 1.5
|
||||||
line_height = tool.Blender.scale_font_size(None) * 1.25
|
line_height = tool.Blender.scale_font_size() * 1.25
|
||||||
blf.size(self.font_id, font_size)
|
blf.size(self.font_id, font_size)
|
||||||
blf.enable(self.font_id, blf.SHADOW)
|
blf.enable(self.font_id, blf.SHADOW)
|
||||||
blf.shadow(self.font_id, 6, 0, 0, 0, 1)
|
blf.shadow(self.font_id, 6, 0, 0, 0, 1)
|
||||||
@@ -516,7 +516,7 @@ class PolylineDecorator:
|
|||||||
self.addon_prefs = tool.Blender.get_addon_preferences()
|
self.addon_prefs = tool.Blender.get_addon_preferences()
|
||||||
self.font_id = 1
|
self.font_id = 1
|
||||||
self.shader = gpu.shader.from_builtin("UNIFORM_COLOR")
|
self.shader = gpu.shader.from_builtin("UNIFORM_COLOR")
|
||||||
font_size = tool.Blender.scale_font_size(None)
|
font_size = tool.Blender.scale_font_size()
|
||||||
blf.size(self.font_id, font_size)
|
blf.size(self.font_id, font_size)
|
||||||
blf.enable(self.font_id, blf.SHADOW)
|
blf.enable(self.font_id, blf.SHADOW)
|
||||||
blf.shadow(self.font_id, 6, 0, 0, 0, 1)
|
blf.shadow(self.font_id, 6, 0, 0, 0, 1)
|
||||||
@@ -1937,7 +1937,7 @@ class BoundingBoxDecorator:
|
|||||||
|
|
||||||
addon_prefs = tool.Blender.get_addon_preferences()
|
addon_prefs = tool.Blender.get_addon_preferences()
|
||||||
font_id = 0
|
font_id = 0
|
||||||
font_size = tool.Blender.scale_font_size(None)
|
font_size = tool.Blender.scale_font_size()
|
||||||
blf.size(font_id, font_size)
|
blf.size(font_id, font_size)
|
||||||
blf.enable(font_id, blf.SHADOW)
|
blf.enable(font_id, blf.SHADOW)
|
||||||
blf.shadow(font_id, 6, 0, 0, 0, 1)
|
blf.shadow(font_id, 6, 0, 0, 0, 1)
|
||||||
|
|||||||
@@ -1571,7 +1571,7 @@ class Blender(bonsai.core.tool.Blender):
|
|||||||
return getattr(scene, "sun_pos_properties", None)
|
return getattr(scene, "sun_pos_properties", None)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def scale_font_size(cls, size):
|
def scale_font_size(cls, size=None):
|
||||||
default_dpi = 72
|
default_dpi = 72
|
||||||
default_pixel_size = 1.0
|
default_pixel_size = 1.0
|
||||||
ui_style = bpy.context.preferences.ui_styles[0]
|
ui_style = bpy.context.preferences.ui_styles[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user