diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-11-13 20:39:18 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-11-13 20:39:18 +0300 |
commit | 73047c69ea803a35f3eb4082b5ccdc7d2c53514d (patch) | |
tree | 6ae8aaf0a693f2a0a983f3fedaca9aff971dc16c /source/blender/editors/interface/interface.c | |
parent | e8a8bb67fcefa5e935214e1af1ec3da38465dda1 (diff) |
BLF: Use Floats for Font Point Sizes
Allow the use of floating-point values for font point sizes, which
allows greater precision and flexibility for text output.
See D8960 for more information, details, and justification.
Differential Revision: https://developer.blender.org/D8960
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9e761d0d07a..67ad4731b18 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1993,23 +1993,9 @@ void UI_block_end(const bContext *C, uiBlock *block) /* ************** BLOCK DRAWING FUNCTION ************* */ -void ui_fontscale(short *points, float aspect) +void ui_fontscale(float *points, float aspect) { - if (aspect < 0.9f || aspect > 1.1f) { - float pointsf = *points; - - /* For some reason scaling fonts goes too fast compared to widget size. */ - /* XXX(ton): not true anymore? */ - // aspect = sqrt(aspect); - pointsf /= aspect; - - if (aspect > 1.0f) { - *points = ceilf(pointsf); - } - else { - *points = floorf(pointsf); - } - } + *points /= aspect; } /* Project button or block (but==NULL) to pixels in region-space. */ |