From 46a40ba66f32e9b17c9f2577f427dd9f3894a9be Mon Sep 17 00:00:00 2001 From: Antoine Charpentier Date: Thu, 15 Sep 2022 10:39:49 +0200 Subject: [PATCH 1/2] clamp instead of resetting --- src/view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view.c b/src/view.c index b3a58bc9..8e969bf1 100644 --- a/src/view.c +++ b/src/view.c @@ -126,7 +126,7 @@ static inline enum window_node_split window_node_get_split(struct window_node *n static inline float window_node_get_ratio(struct window_node *node) { - return in_range_ii(node->ratio, 0.1f, 0.9f) ? node->ratio : g_space_manager.split_ratio; + return clampf_range(node->ratio, 0.1f, 0.9f); } static inline float window_node_get_gap(struct view *view) From b0b5ca480c8117ad2dac406ba7206d0fac0ae5d4 Mon Sep 17 00:00:00 2001 From: Antoine Charpentier Date: Thu, 15 Sep 2022 14:40:35 +0200 Subject: [PATCH 2/2] Additional check for insertion --- src/view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view.c b/src/view.c index 8e969bf1..b352a92b 100644 --- a/src/view.c +++ b/src/view.c @@ -126,7 +126,7 @@ static inline enum window_node_split window_node_get_split(struct window_node *n static inline float window_node_get_ratio(struct window_node *node) { - return clampf_range(node->ratio, 0.1f, 0.9f); + return (node->ratio <= 0.0f) ? g_space_manager.split_ratio : clampf_range(node->ratio, 0.1f, 0.9f); } static inline float window_node_get_gap(struct view *view)