Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
4445:1d41b9bcf74f | 4446:c32b3d10c56b |
---|---|
3599 | 3599 |
3600 pos = (((old_pos * new_pixsize) << 1) + old_pixsize) / div_val; | 3600 pos = (((old_pos * new_pixsize) << 1) + old_pixsize) / div_val; |
3601 /* All but the last window should have a height which is | 3601 /* All but the last window should have a height which is |
3602 a multiple of the default line height. */ | 3602 a multiple of the default line height. */ |
3603 if (!NILP (c->next)) | 3603 if (!NILP (c->next)) |
3604 pos = (pos / line_size) * line_size; | 3604 { |
3605 /* | |
3606 * Round up when we're shrinking, down when we're growing | |
3607 * to make sure that pairs of grow / shrink meant to | |
3608 * cancel out actually do cancel out. | |
3609 */ | |
3610 if (pixel_adj_left < 0) | |
3611 pos = ((pos + line_size -1) / line_size) * line_size; | |
3612 else | |
3613 pos = (pos / line_size) * line_size; | |
3614 } | |
3605 | 3615 |
3606 /* Avoid confusion: don't delete child if it becomes too small */ | 3616 /* Avoid confusion: don't delete child if it becomes too small */ |
3607 set_window_pixsize (child, pos + first - last_pos, 1, set_height); | 3617 set_window_pixsize (child, pos + first - last_pos, 1, set_height); |
3608 | 3618 |
3609 last_pos = pos + first; | 3619 last_pos = pos + first; |