1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Simplify and remove dead code, MAIN_WINDOW_TEXT_HEIGHT(rec) >= WINDOW_MIN_SIZE

always holds.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4948 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-12-06 17:02:27 +00:00 committed by exg
parent fe9b63ef65
commit 04a028d8c9

View File

@ -389,7 +389,7 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff)
rec = tmp->data;
space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE;
if (space <= 0) {
if (space == 0) {
mainwindow_resize(rec, xdiff, 0);
rec->first_line += ydiff;
@ -398,7 +398,6 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff)
continue;
}
if (space <= 0) space = 1;
if (space > -ydiff) space = -ydiff;
rec->last_line += ydiff;
ydiff += space;
@ -428,7 +427,7 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff)
MAIN_WINDOW_REC *rec = tmp->data;
space = MAIN_WINDOW_TEXT_HEIGHT(rec)-WINDOW_MIN_SIZE;
if (ydiff == 0 || (space >= 0 && tmp->next != NULL)) {
if (ydiff == 0 || tmp->next != NULL) {
mainwindow_resize(rec, xdiff, 0);
if (moved > 0) {
rec->first_line += moved;
@ -438,14 +437,8 @@ static void mainwindows_resize_bigger(int xdiff, int ydiff)
continue;
}
if (space < 0 && tmp->next != NULL) {
/* space below minimum */
space = -space;
if (space > ydiff) space = ydiff;
} else {
/* lowest window - give all the extra space for it */
space = ydiff;
}
/* lowest window - give all the extra space for it */
space = ydiff;
ydiff -= space;
rec->first_line += moved;
moved += space;