aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2013-01-04 11:22:37 -0800
committerGlenn Morris2013-01-04 11:22:37 -0800
commit0f668a4db4a33f98f84613513af3efea521b4847 (patch)
treeab85f709ca11c2390dddfc1756656293d6762e55 /src
parent4a1b123d1517bcad22f936df9c39b61fbc3e5359 (diff)
parent92d596112248baecbe6789d450d8e8ea405de19b (diff)
downloademacs-0f668a4db4a33f98f84613513af3efea521b4847.tar.gz
emacs-0f668a4db4a33f98f84613513af3efea521b4847.zip
Merge from emacs-24; up to 2012-12-06T20:16:38Z!monnier@iro.umontreal.ca
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/nsterm.m13
-rw-r--r--src/w32term.c7
-rw-r--r--src/xterm.c7
4 files changed, 27 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5205ef4625e..8fc876e248c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
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
8 * nsterm.m (ns_draw_text_decoration):
9 * w32term.c (x_draw_glyph_string):
10 * xterm.c (x_draw_glyph_string): Don't use previous underline
11 thickness and position if previous underline type is underwave.
12
12013-01-04 Stefan Monnier <monnier@iro.umontreal.ca> 132013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * fileio.c (Ffile_acl): Undocument return format. 15 * fileio.c (Ffile_acl): Undocument return format.
diff --git a/src/nsterm.m b/src/nsterm.m
index c8ce484a432..0fd062b7f17 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2566,7 +2566,7 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2566 Draw a wavy line under glyph string s. The wave fills wave_height 2566 Draw a wavy line under glyph string s. The wave fills wave_height
2567 pixels from y. 2567 pixels from y.
2568 2568
2569 x wave_length = 3 2569 x wave_length = 2
2570 -- 2570 --
2571 y * * * * * 2571 y * * * * *
2572 |* * * * * * * * * 2572 |* * * * * * * * *
@@ -2576,14 +2576,14 @@ ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr)
2576static void 2576static void
2577ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x) 2577ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2578{ 2578{
2579 int wave_height = 3, wave_length = 3; 2579 int wave_height = 3, wave_length = 2;
2580 int y, dx, dy, odd, xmax; 2580 int y, dx, dy, odd, xmax;
2581 NSPoint a, b; 2581 NSPoint a, b;
2582 NSRect waveClip; 2582 NSRect waveClip;
2583 2583
2584 dx = wave_length; 2584 dx = wave_length;
2585 dy = wave_height - 1; 2585 dy = wave_height - 1;
2586 y = s->ybase + 1; 2586 y = s->ybase - wave_height + 3;
2587 xmax = x + width; 2587 xmax = x + width;
2588 2588
2589 /* Find and set clipping rectangle */ 2589 /* Find and set clipping rectangle */
@@ -2592,10 +2592,10 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2592 NSRectClip (waveClip); 2592 NSRectClip (waveClip);
2593 2593
2594 /* Draw the waves */ 2594 /* Draw the waves */
2595 a.x = x - ((int)(x) % dx); 2595 a.x = x - ((int)(x) % dx) + 0.5;
2596 b.x = a.x + dx; 2596 b.x = a.x + dx;
2597 odd = (int)(a.x/dx) % 2; 2597 odd = (int)(a.x/dx) % 2;
2598 a.y = b.y = y; 2598 a.y = b.y = y + 0.5;
2599 2599
2600 if (odd) 2600 if (odd)
2601 a.y += dy; 2601 a.y += dy;
@@ -2606,7 +2606,7 @@ ns_draw_underwave (struct glyph_string *s, CGFloat width, CGFloat x)
2606 { 2606 {
2607 [NSBezierPath strokeLineFromPoint:a toPoint:b]; 2607 [NSBezierPath strokeLineFromPoint:a toPoint:b];
2608 a.x = b.x, a.y = b.y; 2608 a.x = b.x, a.y = b.y;
2609 b.x += dx, b.y = y + odd*dy; 2609 b.x += dx, b.y = y + 0.5 + odd*dy;
2610 odd = !odd; 2610 odd = !odd;
2611 } 2611 }
2612 2612
@@ -2646,6 +2646,7 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face,
2646 2646
2647 /* If the prev was underlined, match its appearance. */ 2647 /* If the prev was underlined, match its appearance. */
2648 if (s->prev && s->prev->face->underline_p 2648 if (s->prev && s->prev->face->underline_p
2649 && s->prev->face->underline_type == FACE_UNDER_LINE
2649 && s->prev->underline_thickness > 0) 2650 && s->prev->underline_thickness > 0)
2650 { 2651 {
2651 thickness = s->prev->underline_thickness; 2652 thickness = s->prev->underline_thickness;
diff --git a/src/w32term.c b/src/w32term.c
index c5681438bfe..36ae4d7797f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -358,7 +358,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s)
358void 358void
359w32_draw_underwave (struct glyph_string *s, COLORREF color) 359w32_draw_underwave (struct glyph_string *s, COLORREF color)
360{ 360{
361 int wave_height = 2, wave_length = 3; 361 int wave_height = 3, wave_length = 2;
362 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 362 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
363 XRectangle wave_clip, string_clip, final_clip; 363 XRectangle wave_clip, string_clip, final_clip;
364 RECT w32_final_clip, w32_string_clip; 364 RECT w32_final_clip, w32_string_clip;
@@ -367,7 +367,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color)
367 dx = wave_length; 367 dx = wave_length;
368 dy = wave_height - 1; 368 dy = wave_height - 1;
369 x0 = s->x; 369 x0 = s->x;
370 y0 = s->ybase + 1; 370 y0 = s->ybase - wave_height + 3;
371 width = s->width; 371 width = s->width;
372 xmax = x0 + width; 372 xmax = x0 + width;
373 373
@@ -2456,7 +2456,8 @@ x_draw_glyph_string (struct glyph_string *s)
2456 unsigned long thickness, position; 2456 unsigned long thickness, position;
2457 int y; 2457 int y;
2458 2458
2459 if (s->prev && s->prev->face->underline_p) 2459 if (s->prev && s->prev->face->underline_p
2460 && s->prev->face->underline_type == FACE_UNDER_LINE)
2460 { 2461 {
2461 /* We use the same underline style as the previous one. */ 2462 /* We use the same underline style as the previous one. */
2462 thickness = s->prev->underline_thickness; 2463 thickness = s->prev->underline_thickness;
diff --git a/src/xterm.c b/src/xterm.c
index e9c4709d999..f63f10566f6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2631,14 +2631,14 @@ x_draw_stretch_glyph_string (struct glyph_string *s)
2631static void 2631static void
2632x_draw_underwave (struct glyph_string *s) 2632x_draw_underwave (struct glyph_string *s)
2633{ 2633{
2634 int wave_height = 2, wave_length = 3; 2634 int wave_height = 3, wave_length = 2;
2635 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; 2635 int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax;
2636 XRectangle wave_clip, string_clip, final_clip; 2636 XRectangle wave_clip, string_clip, final_clip;
2637 2637
2638 dx = wave_length; 2638 dx = wave_length;
2639 dy = wave_height - 1; 2639 dy = wave_height - 1;
2640 x0 = s->x; 2640 x0 = s->x;
2641 y0 = s->ybase + 1; 2641 y0 = s->ybase - wave_height + 3;
2642 width = s->width; 2642 width = s->width;
2643 xmax = x0 + width; 2643 xmax = x0 + width;
2644 2644
@@ -2800,7 +2800,8 @@ x_draw_glyph_string (struct glyph_string *s)
2800 unsigned long thickness, position; 2800 unsigned long thickness, position;
2801 int y; 2801 int y;
2802 2802
2803 if (s->prev && s->prev->face->underline_p) 2803 if (s->prev && s->prev->face->underline_p
2804 && s->prev->face->underline_type == FACE_UNDER_LINE)
2804 { 2805 {
2805 /* We use the same underline style as the previous one. */ 2806 /* We use the same underline style as the previous one. */
2806 thickness = s->prev->underline_thickness; 2807 thickness = s->prev->underline_thickness;