emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog nsterm.m


From: Adrian Robert
Subject: [Emacs-diffs] emacs/src ChangeLog nsterm.m
Date: Fri, 23 Jan 2009 14:32:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 09/01/23 14:32:48

Modified files:
        src            : ChangeLog nsterm.m 

Log message:
        * nsterm.m (ns_draw_glyph_string): Use it, parallel Yamamoto Mitsuharu 
change of 2008-11-15 to other terms. (Bug#615)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7307&r2=1.7308
http://cvs.savannah.gnu.org/viewcvs/emacs/src/nsterm.m?cvsroot=emacs&r1=1.51&r2=1.52

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7307
retrieving revision 1.7308
diff -u -b -r1.7307 -r1.7308
--- ChangeLog   23 Jan 2009 14:08:24 -0000      1.7307
+++ ChangeLog   23 Jan 2009 14:32:47 -0000      1.7308
@@ -13,6 +13,9 @@
        (EmacsView-readSelectionFromPasteboard:)
        (writeSelectionToPasteboard:types:): New stubbed-out methods for
        NSServicesRequests protocol. (Bug#1435)
+       (ns_dumpglyphs_stretch): New function.
+       (ns_draw_glyph_string): Use it, parallel Yamamoto Mitsuharu change
+       of 2008-11-15 to other terms. (Bug#615)
 
        * nsimage.m (setPixmapData:): Set to ignore image DPI.
 

Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- nsterm.m    23 Jan 2009 10:31:54 -0000      1.51
+++ nsterm.m    23 Jan 2009 14:32:47 -0000      1.52
@@ -2893,6 +2893,62 @@
 
 
 static void
+ns_dumpglyphs_stretch (struct glyph_string *s)
+{
+  NSRect r[2];
+  int n, i;
+
+  if (!s->background_filled_p)
+    {
+      n = ns_get_glyph_string_clip_rect (s, r);
+      *r = NSMakeRect (s->x, s->y, s->background_width, s->height);
+
+      for (i=0; i<n; i++)
+        {
+          if (!s->row->full_width_p)
+            {
+              /* truncate to avoid overwriting fringe and/or scrollbar */
+              int overrun = max (0, (s->x + s->background_width)
+                                  - (WINDOW_BOX_RIGHT_EDGE_X (s->w)
+                                    - WINDOW_RIGHT_FRINGE_WIDTH (s->w)));
+              r[i].size.width -= overrun;
+
+              /* XXX: Try to work between problem where a stretch glyph on
+                 a partially-visible bottom row will clear part of the
+                 modeline, and another where list-buffers headers and similar
+                 rows erroneously have visible_height set to 0.  Not sure
+                 where this is coming from as other terms seem not to show. */
+              r[i].size.height = min (s->height, s->row->visible_height);
+            }
+
+          /* expand full-width rows over internal borders */
+          else
+            {
+              r[i] = ns_fix_rect_ibw (r[i], FRAME_INTERNAL_BORDER_WIDTH (s->f),
+                                      FRAME_PIXEL_WIDTH (s->f));
+            }
+
+          /* NOTE: under NS this is NOT used to draw cursors, but we must avoid
+             overwriting cursor (usually when cursor on a tab) */
+          if (s->hl == DRAW_CURSOR)
+            {
+              r[i].origin.x += s->width;
+              r[i].size.width -= s->width;
+            }
+        }
+
+      ns_focus (s->f, r, n);
+      [ns_lookup_indexed_color (NS_FACE_BACKGROUND
+           (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
+      NSRectFill (r[0]);
+      NSRectFill (r[1]);
+      ns_unfocus (s->f);
+      s->background_filled_p = 1;
+    }
+}
+
+
+static void
 ns_draw_glyph_string (struct glyph_string *s)
 /* --------------------------------------------------------------------------
       External (RIF): Main draw-text call.
@@ -2915,10 +2971,17 @@
           width += next->width, next = next->next)
        if (next->first_glyph->type != IMAGE_GLYPH)
           {
+            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);
+              }
             next->num_clips = 0;
           }
     }
@@ -2946,48 +3009,7 @@
       break;
 
     case STRETCH_GLYPH:
-      if (!s->background_filled_p)
-        {
-          *r = NSMakeRect (s->x, s->y, s->background_width, s->height);
-
-          if (!s->row->full_width_p)
-            {
-              /* truncate to avoid overwriting fringe and/or scrollbar */
-              int overrun = max (0, (s->x + s->background_width)
-                                 - (WINDOW_BOX_RIGHT_EDGE_X (s->w)
-                                    - WINDOW_RIGHT_FRINGE_WIDTH (s->w)));
-              r[0].size.width -= overrun;
-
-              /* XXX: Try to work between problem where a stretch glyph on
-                  a partially-visible bottom row will clear part of the
-                  modeline, and another where list-buffers headers and similar
-                  rows erroneously have visible_height set to 0.  Not sure
-                  where this is coming from as other terms seem not to show. */
-              r[0].size.height = min (s->height, s->row->visible_height);
-            }
-
-          /* expand full-width rows over internal borders */
-          else
-            {
-              r[0] = ns_fix_rect_ibw (r[0], FRAME_INTERNAL_BORDER_WIDTH (s->f),
-                                     FRAME_PIXEL_WIDTH (s->f));
-            }
-
-          /* NOTE: under NS this is NOT used to draw cursors, but we must avoid
-             overwriting cursor (usually when cursor on a tab) */
-          if (s->hl == DRAW_CURSOR)
-            {
-              r[0].origin.x += s->width;
-              r[0].size.width -= s->width;
-            }
-
-          ns_focus (s->f, r, 1);
-          [ns_lookup_indexed_color (NS_FACE_BACKGROUND
-               (FACE_FROM_ID (s->f, s->first_glyph->face_id)), s->f) set];
-          NSRectFill (r[0]);
-          ns_unfocus (s->f);
-          s->background_filled_p = 1;
-        }
+      ns_dumpglyphs_stretch (s);
       break;
 
     case CHAR_GLYPH:




reply via email to

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