aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2013-01-04 10:58:07 +0900
committerYAMAMOTO Mitsuharu2013-01-04 10:58:07 +0900
commitf032a318307096c87c4c19928e623e30175d9b1a (patch)
treea292ee0870474b4c965f4d28c0937a58d3e90762 /src
parent4217dc299c3b466e674271f8eb8a0a88e5b3795f (diff)
downloademacs-f032a318307096c87c4c19928e623e30175d9b1a.tar.gz
emacs-f032a318307096c87c4c19928e623e30175d9b1a.zip
Make underwave look more triangular and also degrade gracefully for small fonts. (Bug#13000)
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/nsterm.m12
-rw-r--r--src/w32term.c4
-rw-r--r--src/xterm.c4
4 files changed, 17 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ea882770765..8699dc12d9b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * nsterm.m (ns_draw_underwave):
4 * w32term.c (w32_draw_underwave):
5 * xterm.c (x_draw_underwave): Make underwave look more triangular
6 and also degrade gracefully for small fonts. (Bug#13000)
7
12012-12-31 Glenn Morris <rgm@gnu.org> 82012-12-31 Glenn Morris <rgm@gnu.org>
2 9
3 * keymap.c (Fkey_description): Doc fix. (Bug#13323) 10 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
diff --git a/src/nsterm.m b/src/nsterm.m
index d9ebf714a9a..fce43587b11 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2554,7 +2554,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2554 Draw a wavy line under glyph string s. The wave fills wave_height 2554 Draw a wavy line under glyph string s. The wave fills wave_height
2555 pixels from y. 2555 pixels from y.
2556 2556
2557 x wave_length = 3 2557 x wave_length = 2
2558 -- 2558 --
2559 y * * * * * 2559 y * * * * *
2560 |* * * * * * * * * 2560 |* * * * * * * * *
@@ -2564,14 +2564,14 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2564static void 2564static void
2565ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) 2565ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2566{ 2566{
2567 int wave_height = 3, wave_length = 3; 2567 int wave_height = 3, wave_length = 2;
2568 int y, dx, dy, odd, xmax; 2568 int y, dx, dy, odd, xmax;
2569 NSPoint a, b; 2569 NSPoint a, b;
2570 NSRect waveClip; 2570 NSRect waveClip;
2571 2571
2572 dx = wave_length; 2572 dx = wave_length;
2573 dy = wave_height - 1; 2573 dy = wave_height - 1;
2574 y = s->ybase + 1; 2574 y = s->ybase - wave_height + 3;
2575 xmax = x + width; 2575 xmax = x + width;
2576 2576
2577 /* Find and set clipping rectangle */ 2577 /* Find and set clipping rectangle */
@@ -2580,10 +2580,10 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2580 NSRectClip (waveClip); 2580 NSRectClip (waveClip);
2581 2581
2582 /* Draw the waves */ 2582 /* Draw the waves */
2583 a.x = x - ((int)(x) % dx); 2583 a.x = x - ((int)(x) % dx) + 0.5;
2584 b.x = a.x + dx; 2584 b.x = a.x + dx;
2585 odd = (int)(a.x/dx) % 2; 2585 odd = (int)(a.x/dx) % 2;
2586 a.y = b.y = y; 2586 a.y = b.y = y + 0.5;
2587 2587
2588 if (odd) 2588 if (odd)
2589 a.y += dy; 2589 a.y += dy;
@@ -2594,7 +2594,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2594 { 2594 {
2595 [NSBezierPath strokeLineFromPoint:a toPoint:b]; 2595 [NSBezierPath strokeLineFromPoint:a toPoint:b];
2596 a.x = b.x, a.y = b.y; 2596 a.x = b.x, a.y = b.y;
2597 b.x += dx, b.y = y + odd*dy; 2597 b.x += dx, b.y = y + 0.5 + odd*dy;
2598 odd = !odd; 2598 odd = !odd;
2599 } 2599 }
2600 2600
diff --git a/src/w32term.c b/src/w32term.c
index d7a76ccf773..84afd8c300b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -356,7 +356,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s)
356void 356void
357w32_draw_underwave (struct glyph_string *s, COLORREF color) 357w32_draw_underwave (struct glyph_string *s, COLORREF color)
358{ 358{
359 int wave_height = 2, wave_length = 3; 359 int wave_height = 3, wave_length = 2;
360 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 360 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
361 XRectangle wave_clip, string_clip, final_clip; 361 XRectangle wave_clip, string_clip, final_clip;
362 RECT w32_final_clip, w32_string_clip; 362 RECT w32_final_clip, w32_string_clip;
@@ -365,7 +365,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color)
365 dx = wave_length; 365 dx = wave_length;
366 dy = wave_height - 1; 366 dy = wave_height - 1;
367 x0 = s->x; 367 x0 = s->x;
368 y0 = s->ybase + 1; 368 y0 = s->ybase - wave_height + 3;
369 width = s->width; 369 width = s->width;
370 xmax = x0 + width; 370 xmax = x0 + width;
371 371
diff --git a/src/xterm.c b/src/xterm.c
index 47a38eeefae..32b19b5cffb 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2656,14 +2656,14 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
2656static void 2656static void
2657x_draw_underwave (struct glyph_string *s) 2657x_draw_underwave (struct glyph_string *s)
2658{ 2658{
2659 int wave_height = 2, wave_length = 3; 2659 int wave_height = 3, wave_length = 2;
2660 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 2660 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
2661 XRectangle wave_clip, string_clip, final_clip; 2661 XRectangle wave_clip, string_clip, final_clip;
2662 2662
2663 dx = wave_length; 2663 dx = wave_length;
2664 dy = wave_height - 1; 2664 dy = wave_height - 1;
2665 x0 = s->x; 2665 x0 = s->x;
2666 y0 = s->ybase + 1; 2666 y0 = s->ybase - wave_height + 3;
2667 width = s->width; 2667 width = s->width;
2668 xmax = x0 + width; 2668 xmax = x0 + width;
2669 2669