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/space_spreadsheet
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/space_spreadsheet')
-rw-r--r--source/blender/editors/space_spreadsheet/space_spreadsheet.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
index 435436611c5..5fce0709d10 100644
--- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
+++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc
@@ -327,7 +327,7 @@ static float get_column_width(const ColumnValues &values)
{
float data_width = get_default_column_width(values);
const int fontid = UI_style_get()->widget.uifont_id;
- BLF_size(fontid, UI_DEFAULT_TEXT_POINTS, U.dpi);
+ BLF_size(fontid, UI_DEFAULT_TEXT_POINTS * U.dpi_fac);
const StringRefNull name = values.name();
const float name_width = BLF_width(fontid, name.data(), name.size());
return std::max<float>(name_width / UI_UNIT_X + 1.0f, data_width);
@@ -341,7 +341,7 @@ static float get_column_width_in_pixels(const ColumnValues &values)
static int get_index_column_width(const int tot_rows)
{
const int fontid = UI_style_get()->widget.uifont_id;
- BLF_size(fontid, UI_style_get_dpi()->widget.points * U.pixelsize, U.dpi);
+ BLF_size(fontid, UI_style_get_dpi()->widget.points * U.dpi_fac);
return std::to_string(std::max(0, tot_rows - 1)).size() * BLF_width(fontid, "0", 1) +
UI_UNIT_X * 0.75;
}