From 58b77fb03384dc0cdc6585e18922fb9cf3dee48d Mon Sep 17 00:00:00 2001 From: X23 <-> Date: Mon, 27 Nov 2023 22:56:42 +0800 Subject: [PATCH] Remove dpi in blf.size() calls --- BlenderMalt/MaltNodes/MaltNodeUITools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BlenderMalt/MaltNodes/MaltNodeUITools.py b/BlenderMalt/MaltNodes/MaltNodeUITools.py index 34678fc8..687b419d 100644 --- a/BlenderMalt/MaltNodes/MaltNodeUITools.py +++ b/BlenderMalt/MaltNodes/MaltNodeUITools.py @@ -302,7 +302,7 @@ def draw_modal_interface(operator: 'OT_MaltCycleSubCategories') -> None: batch.draw(shader) gpu.state.blend_set('NONE') - blf.size(font_id, label_style.points * zoom, 72) + blf.size(font_id, label_style.points * zoom) blf.color(font_id, 1,1,1,1) for i, e in enumerate(reversed(prev_enums)): @@ -483,10 +483,10 @@ def context_path_ui_callback(): text = ' > '.join(x.node_tree.name for x in path) preferences = context.preferences ui_scale = preferences.view.ui_scale - dpi = preferences.system.dpi size = preferences.ui_styles[0].widget.points * ui_scale color = preferences.themes[0].node_editor.space.text - blf.size(font_id, size, dpi) + dpi = preferences.system.dpi + blf.size(font_id, size * (dpi / 72.0)) blf.position(font_id, 10, 10, 0) blf.color(font_id, *color, 1) blf.draw(font_id, text) @@ -518,7 +518,7 @@ def tree_preview_ui_callback(): color = (Vector(socket.draw_color(context, node)) + Vector((1,1,1,1))) * 0.5 def draw_text(text: str, size: float, loc: tuple[float, float], color: tuple[float, float, float, float]): - blf.size(font_id, size, 72) + blf.size(font_id, size) blf.position(font_id, *loc, 0) blf.color(font_id, *color) blf.draw(font_id, text)