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:
authorCampbell Barton <campbell@blender.org>2022-04-13 05:45:41 +0300
committerCampbell Barton <campbell@blender.org>2022-04-13 06:06:29 +0300
commit21ae323dbf28b4e0049e68153fe1a310ccf5ebef (patch)
tree184d0ff206289632094a71f574d6c8270c872a3c /source/blender/blenfont/intern/blf_internal.h
parentae43872ad572eb3e6ad1ebfd02921fc2403059bc (diff)
Cleanup: avoid redundant float/int conversions in BLF
Internally many offsets for BLF were integers but exposed as floats, since these are used in pixel-space, many callers were converging them back to integers. Simplify logic by using ints.
Diffstat (limited to 'source/blender/blenfont/intern/blf_internal.h')
-rw-r--r--source/blender/blenfont/intern/blf_internal.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index c38b1654d8e..7754f960043 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -67,18 +67,18 @@ void blf_font_draw_buffer__wrap(struct FontBLF *font,
size_t str_len,
struct ResultBLF *r_info);
size_t blf_font_width_to_strlen(
- struct FontBLF *font, const char *str, size_t str_len, float width, float *r_width);
+ struct FontBLF *font, const char *str, size_t str_len, int width, int *r_width);
size_t blf_font_width_to_rstrlen(
- struct FontBLF *font, const char *str, size_t str_len, float width, float *r_width);
+ struct FontBLF *font, const char *str, size_t str_len, int width, int *r_width);
void blf_font_boundbox(struct FontBLF *font,
const char *str,
size_t str_len,
- struct rctf *r_box,
+ struct rcti *r_box,
struct ResultBLF *r_info);
void blf_font_boundbox__wrap(struct FontBLF *font,
const char *str,
size_t str_len,
- struct rctf *r_box,
+ struct rcti *r_box,
struct ResultBLF *r_info);
void blf_font_width_and_height(struct FontBLF *font,
const char *str,
@@ -97,8 +97,8 @@ float blf_font_height(struct FontBLF *font,
float blf_font_fixed_width(struct FontBLF *font);
int blf_font_height_max(struct FontBLF *font);
int blf_font_width_max(struct FontBLF *font);
-float blf_font_descender(struct FontBLF *font);
-float blf_font_ascender(struct FontBLF *font);
+int blf_font_descender(struct FontBLF *font);
+int blf_font_ascender(struct FontBLF *font);
char *blf_display_name(struct FontBLF *font);
@@ -109,7 +109,7 @@ void blf_font_boundbox_foreach_glyph(struct FontBLF *font,
size_t str_step_ofs,
const struct rcti *glyph_step_bounds,
int glyph_advance_x,
- const struct rctf *glyph_bounds,
+ const struct rcti *glyph_bounds,
const int glyph_bearing[2],
void *user_data),
void *user_data,