Cleanup: pass font drawing x/y offset arguments as int's

Internally these values are ints.
This commit is contained in:
Campbell Barton 2020-04-14 18:41:23 +10:00
parent 3bef5d15d8
commit 571646ebc1
3 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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);
}

View File

@ -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);