Subject: Re: bug#21012: 25.0.50; eww: last char of a line sometimes not fully visible

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 Jul 2015 09:03:17 +0300

> From: Michael Heerdegen <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 09 Jul 2015 22:06:16 +0200
> 
> The problem described by me (from the screenshot) is however not
> completely fixed (recipe follows).
> 
> What I originally posted seems to happen with any text, it is more
> likely to happen when you use positive text-scale-mode, and it still
> happens.
> 
> If you want a precise recipe (though it's just a random example): emacs
> -Q, C-h C-a, click on the first link (named "Gnu Emacs") with mouse-2.
> In line 135, the last char is truncated.
> 
> If you hit C-x C-+, you will find more and more partly visible chars the
> more you scale up.
> 
> Using `end-of-visual-line' seemed to fix this, but we can't use it.
> Is `window-text-pixel-size' useful?

The problem here is that shr assumes that the last character on a
visual line is always fully visible, which is false when
truncate-lines is non-nil.  The last call to forward-char in
shr-vertical-motion should _not_ be made when the character we ended
up at is too wide to be fully visible at the end of a visual line.
The problem is that functions we have that can tell if that happens
require the relevant portion of the buffer to be displayed in some
window, so I think shr.el cannot use them.

If the result of what we have now is too annoying, the only way to
solve it I could think of is to artificially reduce the available
window width by one more column.  This would lose us one column in
some cases, and will not solve the issue completely (a _very_ wide
character will still be partially visible), but it could be a stopgap.

Better ideas are welcome.