unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port
       [not found] <871r3swg23.fsf.ref@yahoo.com>
@ 2021-11-07  8:00 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-07 20:43   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-07  8:00 UTC (permalink / raw)
  To: 51653

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Otherwise, scrolling in a document with stretch glyphs can cause them to
overwrite parts of the mode line, in some cases.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-clipping-when-dumping-stretch-glyphs-in-some-cas.patch --]
[-- Type: text/x-patch, Size: 1257 bytes --]

From 6a2449af61a6be75bd4d0945b8009320745b5ff2 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Sun, 7 Nov 2021 15:58:11 +0800
Subject: [PATCH] Set clipping when dumping stretch glyphs in some cases

* src/nsterm.m (ns_draw_glyph_string): Always focus even when dumping
stretch glyphs in s->next.
---
 src/nsterm.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index a63883cd08..4e84e130b8 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3991,17 +3991,17 @@ Function modeled after x_draw_glyph_string_box ().
 	   width += next->width, next = next->next)
 	if (next->first_glyph->type != IMAGE_GLYPH)
           {
+	    n = ns_get_glyph_string_clip_rect (s->next, r);
+	    ns_focus (s->f, r, n);
             if (next->first_glyph->type != STRETCH_GLYPH)
               {
-                n = ns_get_glyph_string_clip_rect (s->next, r);
-                ns_focus (s->f, r, n);
                 ns_maybe_dumpglyphs_background (s->next, 1);
-                ns_unfocus (s->f);
               }
             else
               {
                 ns_dumpglyphs_stretch (s->next);
               }
+	    ns_unfocus (s->f);
             next->num_clips = 0;
           }
     }
-- 
2.31.1


[-- Attachment #3: Type: text/plain, Size: 9 bytes --]


Thanks.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port
  2021-11-07  8:00 ` bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-07 20:43   ` Lars Ingebrigtsen
  2021-11-07 23:40     ` Alan Third
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-07 20:43 UTC (permalink / raw)
  To: Po Lu; +Cc: alan, 51653

Po Lu <luangruo@yahoo.com> writes:

> * src/nsterm.m (ns_draw_glyph_string): Always focus even when dumping
> stretch glyphs in s->next.

Alan, do you have any comments here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port
  2021-11-07 20:43   ` Lars Ingebrigtsen
@ 2021-11-07 23:40     ` Alan Third
  2021-11-08  0:16       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Third @ 2021-11-07 23:40 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Po Lu, 51653

On Sun, Nov 07, 2021 at 09:43:24PM +0100, Lars Ingebrigtsen wrote:
> Po Lu <luangruo@yahoo.com> writes:
> 
> > * src/nsterm.m (ns_draw_glyph_string): Always focus even when dumping
> > stretch glyphs in s->next.
> 
> Alan, do you have any comments here?

I asked Po Lu to move the focus call out of ns_dumpglyphs_stretch and
into ns_draw_glyph_string as it's the only caller (in two places) and
it meant we didn't have to handle nested ns_focus calls further down.

I forgot to check this call had been fixed in subsequent patch sets.

So yeah, it's good.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port
  2021-11-07 23:40     ` Alan Third
@ 2021-11-08  0:16       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-08  0:16 UTC (permalink / raw)
  To: Alan Third; +Cc: Po Lu, 51653

Alan Third <alan@idiocy.org> writes:

> So yeah, it's good.

Thanks; I've pushed the patch to Emacs 29 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-08  0:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <871r3swg23.fsf.ref@yahoo.com>
2021-11-07  8:00 ` bug#51653: [PATCH] Fix dumping stretch glyph when drawing s->next in NS port Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-07 20:43   ` Lars Ingebrigtsen
2021-11-07 23:40     ` Alan Third
2021-11-08  0:16       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).