mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Fix for unsafe call of MeasureTextEx in GetTextWidth (#204)
This commit is contained in:
@ -3740,8 +3740,8 @@ static int GetTextWidth(const char *text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size = MeasureTextEx(guiFont, text + textIconOffset, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING));
|
||||
float fontSize = (float)GuiGetStyle(DEFAULT, TEXT_SIZE); // ensures guiFont is set
|
||||
size = MeasureTextEx(guiFont, text + textIconOffset, fontSize, (float)GuiGetStyle(DEFAULT, TEXT_SPACING));
|
||||
if (textIconOffset > 0) size.x += (RAYGUI_ICON_SIZE - 4); //ICON_TEXT_PADDING
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user