Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-09-24 03:36:49 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-09-24 03:36:49 +0300
commitcd1631b17dd0e25a8a398fb00a982ca5f0633558 (patch)
treeee8d9cdb560c815ea86d952ef2f053c6435865c1 /source/blender/editors/mesh
parent88a602bc64fc2a86411d67881439a04486f95030 (diff)
BLF: Refactor of DPI
Correction of U.dpi to hold actual monitor DPI. Simplify font sizing by omitting DPI as API argument, always using 72 internally. See D15961 for more details. Differential Revision: https://developer.blender.org/D15961 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c2
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 0a6feeb3665..c78279b7971 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -260,7 +260,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
int otype = RNA_enum_get(op->ptr, "offset_type");
opdata->value_mode = (otype == BEVEL_AMT_PERCENT) ? OFFSET_VALUE_PERCENT : OFFSET_VALUE;
opdata->segments = (float)RNA_int_get(op->ptr, "segments");
- float pixels_per_inch = U.dpi * U.pixelsize;
+ float pixels_per_inch = U.dpi;
for (int i = 0; i < NUM_VALUE_KINDS; i++) {
opdata->shift_value[i] = -1.0f;
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 156698be567..d364aa2274f 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -495,7 +495,7 @@ static void knifetool_draw_visible_distances(const KnifeTool_OpData *kcd)
float numstr_size[2];
float posit[2];
const float bg_margin = 4.0f * U.dpi_fac;
- const float font_size = 14.0f * U.pixelsize;
+ const float font_size = 14.0f;
const int distance_precision = 4;
/* Calculate distance and convert to string. */
@@ -516,7 +516,7 @@ static void knifetool_draw_visible_distances(const KnifeTool_OpData *kcd)
}
BLF_enable(blf_mono_font, BLF_ROTATION);
- BLF_size(blf_mono_font, font_size, U.dpi);
+ BLF_size(blf_mono_font, font_size * U.dpi_fac);
BLF_rotation(blf_mono_font, 0.0f);
BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]);
@@ -565,7 +565,7 @@ static void knifetool_draw_angle(const KnifeTool_OpData *kcd,
const float arc_size = 64.0f * U.dpi_fac;
const float bg_margin = 4.0f * U.dpi_fac;
const float cap_size = 4.0f * U.dpi_fac;
- const float font_size = 14.0f * U.pixelsize;
+ const float font_size = 14.0f;
const int angle_precision = 3;
/* Angle arc in 3d space. */
@@ -646,7 +646,7 @@ static void knifetool_draw_angle(const KnifeTool_OpData *kcd,
}
BLF_enable(blf_mono_font, BLF_ROTATION);
- BLF_size(blf_mono_font, font_size, U.dpi);
+ BLF_size(blf_mono_font, font_size * U.dpi_fac);
BLF_rotation(blf_mono_font, 0.0f);
BLF_width_and_height(blf_mono_font, numstr, sizeof(numstr), &numstr_size[0], &numstr_size[1]);