Mercurial > hg > xemacs-beta
diff src/window.c @ 4446:c32b3d10c56b
Fix problem with `resize-minibuffer-mode'.
2008-04-26 Mike Sperber <mike@xemacs.org>
* window.c (set_window_pixsize): Round up when we're shrinking,
down when we're growing * to make sure that pairs of grow / shrink
meant to * cancel out actually do cancel out. This fixes a
problem with `resize-minibuffer-mode' where successive grow/shrink
actions are meant to cancel out, but previously didn't.
author | Mike Sperber <sperber@deinprogramm.de> |
---|---|
date | Sat, 26 Apr 2008 16:28:44 +0200 |
parents | 74e0e1131e01 |
children | 80cd90837ac5 |
line wrap: on
line diff
--- a/src/window.c Sun Apr 13 11:18:00 2008 +0200 +++ b/src/window.c Sat Apr 26 16:28:44 2008 +0200 @@ -3601,7 +3601,17 @@ /* All but the last window should have a height which is a multiple of the default line height. */ if (!NILP (c->next)) - pos = (pos / line_size) * line_size; + { + /* + * Round up when we're shrinking, down when we're growing + * to make sure that pairs of grow / shrink meant to + * cancel out actually do cancel out. + */ + if (pixel_adj_left < 0) + pos = ((pos + line_size -1) / line_size) * line_size; + else + pos = (pos / line_size) * line_size; + } /* Avoid confusion: don't delete child if it becomes too small */ set_window_pixsize (child, pos + first - last_pos, 1, set_height);