mirror of
https://github.com/NickHu/sway
synced 2024-12-25 21:58:16 +01:00
Ensure get_text_width() returns a positive value
Closes: https://github.com/swaywm/sway/issues/7940
This commit is contained in:
parent
c8676fad54
commit
ba427a469a
1 changed files with 3 additions and 3 deletions
|
@ -58,11 +58,11 @@ struct text_buffer {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int get_text_width(struct sway_text_node *props) {
|
static int get_text_width(struct sway_text_node *props) {
|
||||||
|
int width = props->width;
|
||||||
if (props->max_width) {
|
if (props->max_width) {
|
||||||
return MIN(props->max_width, props->width);
|
width = MIN(width, props->max_width);
|
||||||
}
|
}
|
||||||
|
return MAX(width, 0);
|
||||||
return props->width;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_source_box(struct text_buffer *buffer) {
|
static void update_source_box(struct text_buffer *buffer) {
|
||||||
|
|
Loading…
Reference in a new issue