emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 77c3d41adc: Prevent text decorations from overwriting surroun


From: Po Lu
Subject: Re: master 77c3d41adc: Prevent text decorations from overwriting surrounding areas on X
Date: Tue, 11 Jan 2022 08:37:11 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> I'm not sure I understand what clipping did you have in mind.  In
> x_draw_underwave, for example, we have this:
>
>   /* Find and set clipping rectangle */
>
>   wave_clip.x = x0;
>   wave_clip.y = y0;
>   wave_clip.width = width;
>   wave_clip.height = wave_height;
>   get_glyph_string_clip_rect (s, &string_clip);
>
>   if (!gui_intersect_rectangles (&wave_clip, &string_clip, &final_clip))
>     return;
>
>   XSetClipRectangles (display, s->gc, 0, 0, &final_clip, 1, Unsorted);
>
> Isn't this the clipping?  Or what am I missing?

That's only done in x_draw_underwave, and nowhere else where text
decorations (underlines and overlines) are drawn.

>> You can test by running custom-set-faces on default, enabling an
>> underline or overline, and typing in a field that is extended to the end
>> of the line.

> Please show some actual Lisp to try this, so we wouldn't need to guess
> whether the problem doesn't exist or we failed to reproduce correctly.

After loading the definition of widget-field, just do this in an empty
buffer:

  (set-face-attribute 'default nil :underline t)
  (save-excursion
    (insert (propertize "foo\n" 'face 'widget-field)))
  (redisplay)
  (insert "a")

The underline of the first line will then overwrite the right fringe.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]