[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: window-text-pixel-size and presumable move_it_to change(s)
From: |
martin rudalics |
Subject: |
Re: window-text-pixel-size and presumable move_it_to change(s) |
Date: |
Fri, 24 Jun 2016 10:09:34 +0200 |
> The problem is in the new code
> in Fwindow_text_pixel_size:
>
> x = min (move_it_to (&it, end, INT_MAX, max_y, -1,
> MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y),
> max_x);
>
> This will call move_it_to twice, and the second call will return a
> different value from the correct one, returned by the first call.
> Replace this by something less fancy, like
>
> x = move_it_to (&it, end, INT_MAX, max_y, -1,
> MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
> if (x > max_x)
> x = max_x;
>
> and Bob'll be your uncle.
That was the cause. Thanks for the solution.
> (In general, I suggest to make a rule to never use 'min' or 'max' when
> their arguments are expressions.)
Indeed, I have to be more careful in this regard.
Many thanks, martin