diff options
-rw-r--r-- | sway/sway_text_node.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/sway_text_node.c b/sway/sway_text_node.c index b9a77d94..664db40e 100644 --- a/sway/sway_text_node.c +++ b/sway/sway_text_node.c | |||
@@ -58,11 +58,11 @@ struct text_buffer { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | static int get_text_width(struct sway_text_node *props) { | 60 | static int get_text_width(struct sway_text_node *props) { |
61 | int width = props->width; | ||
61 | if (props->max_width) { | 62 | if (props->max_width) { |
62 | return MIN(props->max_width, props->width); | 63 | width = MIN(width, props->max_width); |
63 | } | 64 | } |
64 | 65 | return MAX(width, 0); | |
65 | return props->width; | ||
66 | } | 66 | } |
67 | 67 | ||
68 | static void update_source_box(struct text_buffer *buffer) { | 68 | static void update_source_box(struct text_buffer *buffer) { |