summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-05-07 18:13:32 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-05-07 18:13:32 +0200
commitd961711797a414592194a7a628a0151d89afbccc (patch)
treec955d062b748a641a746f42f85e053e640cfed60 /src/gui
parent8c9ba6b5638eeedce99dbc1456af47b218f39867 (diff)
downloadweechat-d961711797a414592194a7a628a0151d89afbccc.zip
core: fix balance of windows with vertical split
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/curses/gui-curses-window.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 9c4fc87e1..4c2099c5a 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1999,9 +1999,12 @@ gui_window_balance (struct t_gui_window_tree *tree)
count_left = gui_window_balance_count (tree->child1, tree->split_horizontal) + 1;
count_right = gui_window_balance_count (tree->child2, tree->split_horizontal) + 1;
if (count_right > count_left)
- new_split = 100 - ((count_left * 100) / (count_left + count_right));
+ new_split = (count_left * 100) / (count_left + count_right);
else
new_split = (count_right * 100) / (count_left + count_right);
+ if ((tree->split_horizontal && (count_right > count_left))
+ || (!tree->split_horizontal && (count_left > count_right)))
+ new_split = 100 - new_split;
if (tree->split_pct != new_split)
{
tree->split_pct = new_split;