BLF: assert alpha doesn't exceed 1.0 for icon outlines
Causes undefined behavior, so the caller needs to clamp.
This commit is contained in:
@@ -526,6 +526,7 @@ void blf_draw_svg_icon(FontBLF *font,
|
||||
bool multicolor,
|
||||
blender::FunctionRef<void(std::string &)> edit_source_cb)
|
||||
{
|
||||
BLI_assert(outline_alpha <= 1.0f); /* Higher values overflow, caller must ensure. */
|
||||
blf_font_size(font, size);
|
||||
font->pos[0] = int(x);
|
||||
font->pos[1] = int(y);
|
||||
|
||||
@@ -101,6 +101,9 @@ bool blf_font_size(FontBLF *font, float size);
|
||||
void blf_font_draw(FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info);
|
||||
void blf_font_draw__wrap(FontBLF *font, const char *str, size_t str_len, ResultBLF *r_info);
|
||||
|
||||
/**
|
||||
* \param outline_alpha: Alpha value between 0 and 1.
|
||||
*/
|
||||
void blf_draw_svg_icon(FontBLF *font,
|
||||
uint icon_id,
|
||||
float x,
|
||||
|
||||
Reference in New Issue
Block a user