From 1fb9283849f12593e099cefa1f916d0dd8fce970 Mon Sep 17 00:00:00 2001 From: Louis Hampton Date: Fri, 12 Jun 2020 16:51:50 +0100 Subject: [PATCH] Style improvements and readability --- sway/input/seatop_resize_floating.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sway/input/seatop_resize_floating.c b/sway/input/seatop_resize_floating.c index 3c040a2da..72658cedc 100644 --- a/sway/input/seatop_resize_floating.c +++ b/sway/input/seatop_resize_floating.c @@ -74,12 +74,12 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, double height = e->ref_height + grow_height; int min_width, max_width, min_height, max_height; floating_calculate_constraints(&min_width, &max_width, - &min_height, &max_height); - double bounded_width = fmax(min_width + border_width, - fmin(width, max_width - border_width)); - double bounded_height = fmax(min_height + border_height, - fmin(height, max_height - border_height)); - width = fmax(bounded_width, 1); + &min_height, &max_height); + width = fmin(width, max_width - border_width) + width = fmax(min_width + border_width, width); + width = fmax(width, 1); + height = fmin(height, max_height - border_height); + height = fmax(min_height + border_height, height); height = fmax(bounded_height, 1); // Apply the view's min/max size @@ -87,11 +87,11 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec, double view_min_width, view_max_width, view_min_height, view_max_height; view_get_constraints(con->view, &view_min_width, &view_max_width, &view_min_height, &view_max_height); - double bounded_view_width = fmax(view_min_width + border_width, - fmin(width, view_max_width - border_width)); - double bounded_view_height = fmax(view_min_height + border_height, - fmin(height, view_max_height - border_height)); + width = fmin(width, view_max_width - border_width); + width = fmax(view_min_width + border_width, width); width = fmax(bounded_view_width, 1); + height = fmin(height, view_max_height - border_height); + height = fmax(view_min_height + border_height, height); height = fmax(bounded_view_height, 1); }