diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-03 09:51:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-03 09:51:34 +0300 |
commit | 0d65520f05ec5474e62d453aa62eb06efa3981d7 (patch) | |
tree | 2436b0d13a234c474f3bd2cf55bec6014603f886 /source/blender/editors/interface/interface_widgets.c | |
parent | d388c1c524948df17d6c74c3830f2803ac4933b4 (diff) |
BLF: add new arguments to BLF_GlyphBoundsFn
- glyph_bounds: to get the character width.
- glyph_bearing: lower left character starting point.
These values are needed for more precise glyph calculations.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 0142f3b38e0..e927d259926 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2095,15 +2095,17 @@ static void widget_draw_text_ime_underline(const uiFontStyle *fstyle, #endif /* WITH_INPUT_IME */ static bool widget_draw_text_underline_calc_center_x(const char *UNUSED(str), - const size_t str_ofs, - const rcti *glyph_bounds, + const size_t str_step_ofs, + const rcti *glyph_step_bounds, const int glyph_advance_x, + const rctf *UNUSED(glyph_bounds), + const float UNUSED(glyph_bearing[2]), void *user_data) { /* The index of the character to get, set to the x-position. */ int *ul_data = user_data; - if (ul_data[0] == (int)str_ofs) { - ul_data[1] = glyph_bounds->xmin + (glyph_advance_x / 2); + if (ul_data[0] == (int)str_step_ofs) { + ul_data[1] = glyph_step_bounds->xmin + (glyph_advance_x / 2); /* Early exit. */ return false; } |