From 1320a80e669c272c80f50e670684b1b689dcf4b2 Mon Sep 17 00:00:00 2001 From: sabetts Date: Fri, 18 Oct 2002 09:03:42 +0000 Subject: * src/actions.c (read_split): a negative number means subtract the pixels from the frame's current size to get the new frame's size. --- src/actions.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index 87ad310..579d2ad 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1273,12 +1273,14 @@ read_split (const char *str, int max) p = (int)(max * (float)(a) / (float)(b)); } else if (sscanf(str, "%d", &p) == 1) - { + { + if (p < 0) + p = max + p; } else { /* Failed to read input. */ - p = -1; + return -1; } /* Input out of range. */ @@ -1296,9 +1298,10 @@ cmd_h_split (int interactive, void *data) /* Default to dividing the frame in half. */ if (data == NULL) pixels = current_screen()->rp_current_frame->height / 2; - else + else pixels = read_split (data, current_screen()->rp_current_frame->height); + if (pixels > 0) h_split_frame (current_screen()->rp_current_frame, pixels); -- cgit v1.2.3