diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 14:43:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-12 14:44:26 +0300 |
commit | e5766752d04794c2693dedad75baeb8c7d68f4cf (patch) | |
tree | 7f5354d1272612a32c28bfda4c03259970c402b7 /source/blender/editors/interface/interface_style.c | |
parent | b2ccd8546c7249a5ce279210d45ddbb5e90cd10d (diff) |
Revert "BLI: Refactor vector types & functions to use templates"
Reverted because the commit removes a lot of commits.
This reverts commit a2c1c368af48644fa8995ecbe7138cc0d7900c30.
Diffstat (limited to 'source/blender/editors/interface/interface_style.c')
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index c28769a4951..44942d508ca 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -140,9 +140,9 @@ static uiFont *uifont_to_blfont(int id) void UI_fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, + const size_t str_len, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params, - size_t len, int *r_xofs, int *r_yofs, struct ResultBLF *r_info) @@ -183,10 +183,10 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs, } if (fs_params->align == UI_STYLE_TEXT_CENTER) { - xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len))); + xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len))); } else if (fs_params->align == UI_STYLE_TEXT_RIGHT) { - xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len); + xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, str_len); } yofs = MAX2(0, yofs); @@ -196,7 +196,7 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs, BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f); BLF_color4ubv(fs->uifont_id, col); - BLF_draw_ex(fs->uifont_id, str, len, r_info); + BLF_draw_ex(fs->uifont_id, str, str_len, r_info); BLF_disable(fs->uifont_id, font_flag); @@ -211,12 +211,11 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs, void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, + const size_t str_len, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params) { - int xofs, yofs; - - UI_fontstyle_draw_ex(fs, rect, str, col, fs_params, BLF_DRAW_STR_DUMMY_MAX, &xofs, &yofs, NULL); + UI_fontstyle_draw_ex(fs, rect, str, str_len, col, fs_params, NULL, NULL, NULL); } void UI_fontstyle_draw_rotated(const uiFontStyle *fs, |