diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-14 11:41:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-14 11:41:23 +0300 |
commit | 571646ebc175877225c26a3dcf8869691cf70ba7 (patch) | |
tree | d7323a486140a2bcaa3e6222b2be35bf4ca6dc43 /source/blender | |
parent | 3bef5d15d8c0a3a23922c0658ea4e0654199f0b4 (diff) |
Cleanup: pass font drawing x/y offset arguments as int's
Internally these values are ints.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index eb134646649..1133f9e72c4 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -2415,8 +2415,8 @@ void UI_fontstyle_draw_ex(const struct uiFontStyle *fs, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params, size_t len, - float *r_xofs, - float *r_yofs); + int *r_xofs, + int *r_yofs); void UI_fontstyle_draw(const struct uiFontStyle *fs, const struct rcti *rect, const char *str, diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 63fc7825b26..a67d4f4ce83 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -147,8 +147,8 @@ void UI_fontstyle_draw_ex(const uiFontStyle *fs, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params, size_t len, - float *r_xofs, - float *r_yofs) + int *r_xofs, + int *r_yofs) { int xofs = 0, yofs; int font_flag = BLF_CLIPPING; @@ -210,7 +210,7 @@ void UI_fontstyle_draw(const uiFontStyle *fs, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params) { - float xofs, yofs; + int xofs, yofs; UI_fontstyle_draw_ex(fs, rect, str, col, fs_params, BLF_DRAW_STR_DUMMY_MAX, &xofs, &yofs); } diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index fa4a0a1e07d..88bc4c38fd3 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2300,7 +2300,7 @@ static void widget_draw_text(const uiFontStyle *fstyle, if (!use_right_only) { /* for underline drawing */ - float font_xofs, font_yofs; + int font_xofs, font_yofs; int drawlen = (drawstr_left_len == INT_MAX) ? strlen(drawstr + but->ofs) : (drawstr_left_len - but->ofs); @@ -2342,7 +2342,7 @@ static void widget_draw_text(const uiFontStyle *fstyle, ul_advance = BLF_width(fstyle->uifont_id, fixedbuf, ul_index) + (1.0f * UI_DPI_FAC); BLF_position(fstyle->uifont_id, - rect->xmin + font_xofs + ul_advance, + rect->xmin + font_xofs + (int)ul_advance, rect->ymin + font_yofs, 0.0f); BLF_color4ubv(fstyle->uifont_id, wcol->text); |