emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111129: Make underwave look more


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111129: Make underwave look more triangular and also degrade gracefully for small fonts. (Bug#13000)
Date: Fri, 04 Jan 2013 10:58:07 +0900
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111129
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: emacs-24
timestamp: Fri 2013-01-04 10:58:07 +0900
message:
  Make underwave look more triangular and also degrade gracefully for small 
fonts.  (Bug#13000)
modified:
  src/ChangeLog
  src/nsterm.m
  src/w32term.c
  src/xterm.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-01-01 09:11:05 +0000
+++ b/src/ChangeLog     2013-01-04 01:58:07 +0000
@@ -1,3 +1,10 @@
+2013-01-04  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * nsterm.m (ns_draw_underwave):
+       * w32term.c (w32_draw_underwave):
+       * xterm.c (x_draw_underwave): Make underwave look more triangular
+       and also degrade gracefully for small fonts.  (Bug#13000)
+
 2012-12-31  Glenn Morris  <address@hidden>
 
        * keymap.c (Fkey_description): Doc fix.  (Bug#13323)

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-01-01 09:11:05 +0000
+++ b/src/nsterm.m      2013-01-04 01:58:07 +0000
@@ -2554,7 +2554,7 @@
    Draw a wavy line under glyph string s. The wave fills wave_height
    pixels from y.
 
-                    x          wave_length = 3
+                    x          wave_length = 2
                                  --
                 y    *   *   *   *   *
                      |* * * * * * * * *
@@ -2564,14 +2564,14 @@
 static void
 ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
 {
-  int wave_height = 3, wave_length = 3;
+  int wave_height = 3, wave_length = 2;
   int y, dx, dy, odd, xmax;
   NSPoint a, b;
   NSRect waveClip;
 
   dx = wave_length;
   dy = wave_height - 1;
-  y =  s->ybase + 1;
+  y =  s->ybase - wave_height + 3;
   xmax = x + width;
 
   /* Find and set clipping rectangle */
@@ -2580,10 +2580,10 @@
   NSRectClip (waveClip);
 
   /* Draw the waves */
-  a.x = x - ((int)(x) % dx);
+  a.x = x - ((int)(x) % dx) + 0.5;
   b.x = a.x + dx;
   odd = (int)(a.x/dx) % 2;
-  a.y = b.y = y;
+  a.y = b.y = y + 0.5;
 
   if (odd)
     a.y += dy;
@@ -2594,7 +2594,7 @@
     {
       [NSBezierPath strokeLineFromPoint:a toPoint:b];
       a.x = b.x, a.y = b.y;
-      b.x += dx, b.y = y + odd*dy;
+      b.x += dx, b.y = y + 0.5 + odd*dy;
       odd = !odd;
     }
 

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2013-01-01 09:11:05 +0000
+++ b/src/w32term.c     2013-01-04 01:58:07 +0000
@@ -356,7 +356,7 @@
 void
 w32_draw_underwave (struct glyph_string *s, COLORREF color)
 {
-  int wave_height = 2, wave_length = 3;
+  int wave_height = 3, wave_length = 2;
   int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
   XRectangle wave_clip, string_clip, final_clip;
   RECT w32_final_clip, w32_string_clip;
@@ -365,7 +365,7 @@
   dx = wave_length;
   dy = wave_height - 1;
   x0 = s->x;
-  y0 = s->ybase + 1;
+  y0 = s->ybase - wave_height + 3;
   width = s->width;
   xmax = x0 + width;
 

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2013-01-01 09:11:05 +0000
+++ b/src/xterm.c       2013-01-04 01:58:07 +0000
@@ -2656,14 +2656,14 @@
 static void
 x_draw_underwave (struct glyph_string *s)
 {
-  int wave_height = 2, wave_length = 3;
+  int wave_height = 3, wave_length = 2;
   int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
   XRectangle wave_clip, string_clip, final_clip;
 
   dx = wave_length;
   dy = wave_height - 1;
   x0 = s->x;
-  y0 = s->ybase + 1;
+  y0 = s->ybase - wave_height + 3;
   width = s->width;
   xmax = x0 + width;
 


reply via email to

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