mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-09-20 22:11:59 +00:00
fix underflow in text length
This commit is contained in:
parent
4e2ab9b2b7
commit
13c3655da4
1 changed files with 2 additions and 1 deletions
|
@ -113,7 +113,8 @@ void text_clear_pointers(struct text* text) {
|
|||
uint32_t text_get_length(struct text* text, bool override) {
|
||||
if (!text->drawing) return 0;
|
||||
if (text->has_const_width && !override) return text->custom_width;
|
||||
return text->bounds.size.width + text->padding_left + text->padding_right;
|
||||
int len = text->bounds.size.width + text->padding_left + text->padding_right;
|
||||
return (len < 0 ? 0 : len);
|
||||
}
|
||||
|
||||
uint32_t text_get_height(struct text* text) {
|
||||
|
|
Loading…
Reference in a new issue