Re: PATCH: Fix for an underlining bug.


Subject: Re: PATCH: Fix for an underlining bug.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Thu Mar 23 2000 - 20:26:34 CST


On Thu, 23 Mar 2000, Robert Sievers wrote:
>
> Wow! I didn't even realize that bug was there.
>
> The patch went in cleanly, and works as you intended. Underlining and
> their corresponding intersection with superscripts now works as people
> would expect. I didn't actually commit the changes though due to a new bug
> that shows up. If you select a piece of text which is underlined, the
> underline disappears for the selection region, and as you drag around, it
> starts reappearing in chunks, and this looks rather odd. Before the patch,
> the underline never disappeared at all when text was selected.
>
> Is this something you can take a look at before we do a check in?
>

Hmm, err yes, well, I do know about this and chose to ignore it because I
thought I thought it would require me do some surgury to parts of abi I
don't understand very well. The problem is that underlining several text
runs requires that the underline be drawn after waiting until the end of
the underlined span is drawn. When highlighting, only the current text
run is redrawn. If the underline continues outside the highlighted text
run, the code doesn't draw the line because the run containing the end of
the underline is not reached.

To fix this would require either:

1. That highlighting redraw all the text contained within the underline
span that intercepts the highlighted text. Actually this would not be too
hard to implement but might affect performance.

2. Or coming up with a hack that determines if the current span is being
highlighted and if so, to skip ahead through the text to find the end of
the underlining span and finding the position of the underline then, and
redraw. This seems tricky to me.

3. Expand the textRUN class to include a flag to tell if the current run
is being highlighted and just use the current underline position if it is.
This might work but it might also screw up if the highlighted text changes
size (eg via a font size change). Hmm actually this will probabally work
because a change of text height triggers a complete redraw of a line
anyway, which will put the underline (or overline) at the right place.

Hmm I'll have a go at 1 and 3. I wish I'd thought of it earlier! It might
take a few days.

I should have known better than to sneak a bug past you Bob :-)

Cheers

Martin



This archive was generated by hypermail 2b25 : Thu Mar 23 2000 - 20:26:41 CST