Fix #123594: ICON_NONE Should be No Op

Using ICON_NONE causes textures to be referenced even though nothing
is ultimately drawn. This adds an early exit for this value, and also
changes the type of it from ICON_TYPE_COLOR_TEXTURE (used to display
a full-color bitmap) to ICON_TYPE_MONO_TEXTURE (normal one-color type
now coming from SVG).

Pull Request: https://projects.blender.org/blender/blender/pulls/123609
This commit is contained in:
Harley Acheson
2024-06-22 19:26:21 +02:00
committed by Harley Acheson
parent 8cfe25b90c
commit c295c9f818
2 changed files with 5 additions and 1 deletions

View File

@@ -38,7 +38,7 @@
#endif
/* ICON_ prefix added */
DEF_ICON_COLOR(NONE)
DEF_ICON(NONE)
DEF_ICON(QUESTION)
DEF_ICON(ERROR)
DEF_ICON(CANCEL)

View File

@@ -1853,6 +1853,10 @@ static void icon_draw_size(float x,
const IconTextOverlay *text_overlay,
const bool inverted = false)
{
if (icon_id == ICON_NONE) {
return;
}
bTheme *btheme = UI_GetTheme();
const float fdraw_size = float(draw_size);