Subject: Re: bug#11464: 24.1.50; pos-visible-in-window-p returns a false positive with bidi text

From: Eli Zaretskii <[email-masked]>
Date: Fri, 18 May 2012 10:42:35 +0300

> From: Michael Welsh Duggan <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Thu, 17 May 2012 17:22:36 -0400
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Michael Welsh Duggan <[email-masked]>
> >> Cc: Ari Roponen <[email-masked]>, [email-masked]
> >> Date: Thu, 17 May 2012 13:56:45 -0400
> >> 
> >>   else if (top_y < it.last_visible_y) ==> if (255 < 256) ==> if (TRUE)
> >> 
> >> hence, visible_p _would_ be set to 1 by the else if clause.
> >
> > And will never be reset to zero, because 27 <= 256 => FALSE.  And yet
> > Ari said that he needed to change the condition to <=.
> 
> But where do you get 27?  The number was 270, I believe.

It's 270, yes.  But the rest is correct: if visible_p is set  in this
case, it will never be reset with the current code.  My original code
used

      if (bottom_y >= it.last_visible_y

which would have caught this case.

Ari, can you please describe again what happens in this particular
case on your machine, step by step, when you step with a debugger
through the relevant fragment?

I'm sorry I keep asking questions, but I must understand what was
incorrect in my original reasoning, to make sure there's no subtle
bugs lurking here.

Also, for this case:

>  bottom_y = 300
>  it.last_visible_y = 304

can you show the corresponding values of top_y and window_top_y?

Thanks.