aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-07-19 13:42:43 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-07-22 23:10:19 +1000
commitc299b6b5cd72ce186baa9a0a1cc09a4293431d74 (patch)
tree90382d0c2cfc59f69262d81551d797be968efe87 /sway/input
parentf9491c9584d2c1fb789eee9c9e21fd6c274f4579 (diff)
downloadsway-c299b6b5cd72ce186baa9a0a1cc09a4293431d74.tar.xz
Use max multiplier when resizing while preserving ratio
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index e5631f5b..a24a7de8 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -238,9 +238,9 @@ static void handle_resize_motion(struct sway_seat *seat,
if (seat->op_resize_preserve_ratio) {
double x_multiplier = grow_width / seat->op_ref_width;
double y_multiplier = grow_height / seat->op_ref_height;
- double avg_multiplier = (x_multiplier + y_multiplier) / 2;
- grow_width = seat->op_ref_width * avg_multiplier;
- grow_height = seat->op_ref_height * avg_multiplier;
+ double max_multiplier = fmax(x_multiplier, y_multiplier);
+ grow_width = seat->op_ref_width * max_multiplier;
+ grow_height = seat->op_ref_height * max_multiplier;
}
// Determine new width/height, and accommodate for min/max values