aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes2001-02-12 14:50:08 +0000
committerAndrew Innes2001-02-12 14:50:08 +0000
commit60222d69c6d0c46532c9f1f7824f2c7c992da39e (patch)
treea93a6c6915c6355b9179d1c740366eb59737d775 /src
parent6c542587e5679ea7a3ea47190675ce419a4f0095 (diff)
downloademacs-60222d69c6d0c46532c9f1f7824f2c7c992da39e.tar.gz
emacs-60222d69c6d0c46532c9f1f7824f2c7c992da39e.zip
(x_produce_image_glyph): Pay attention to the case that
face->box_line_width is negative. (x_produce_stretch_glyph): Likewise. (x_produce_glyphs): Likewise. (x_estimate_mode_line_height): Likewise. (x_draw_glyph_string_background): Likewise. (x_draw_glyph_string_foreground): Likewise. (x_draw_composite_glyph_string_foreground): Likewise. (x_draw_glyph_string_box): Likewise. (x_draw_image_foreground): Likewise. (x_draw_image_relief): Likewise. (x_draw_image_foreground_1): Likewise. (x_draw_image_glyph_string): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog19
-rw-r--r--src/w32term.c97
2 files changed, 81 insertions, 35 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8fe9acd1b7..d0217b2e975 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12001-02-12 Andrew Innes <andrewi@gnu.org>
2
3 The following changes are to draw box lines inside characters area
4 if line-width is negative.
5
6 * w32term.c (x_produce_image_glyph): Pay attention to the case that
7 face->box_line_width is negative.
8 (x_produce_stretch_glyph): Likewise.
9 (x_produce_glyphs): Likewise.
10 (x_estimate_mode_line_height): Likewise.
11 (x_draw_glyph_string_background): Likewise.
12 (x_draw_glyph_string_foreground): Likewise.
13 (x_draw_composite_glyph_string_foreground): Likewise.
14 (x_draw_glyph_string_box): Likewise.
15 (x_draw_image_foreground): Likewise.
16 (x_draw_image_relief): Likewise.
17 (x_draw_image_foreground_1): Likewise.
18 (x_draw_image_glyph_string): Likewise.
19
12001-02-09 Kenichi Handa <handa@etl.go.jp> 202001-02-09 Kenichi Handa <handa@etl.go.jp>
2 21
3 The following changes are to draw box lines inside characters area 22 The following changes are to draw box lines inside characters area
diff --git a/src/w32term.c b/src/w32term.c
index 18a613a15cb..11c9fc85edc 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1721,13 +1721,16 @@ x_produce_image_glyph (it)
1721 1721
1722 if (face->box != FACE_NO_BOX) 1722 if (face->box != FACE_NO_BOX)
1723 { 1723 {
1724 it->ascent += face->box_line_width; 1724 if (face->box_line_width > 0)
1725 it->descent += face->box_line_width; 1725 {
1726 it->ascent += face->box_line_width;
1727 it->descent += face->box_line_width;
1728 }
1726 1729
1727 if (it->start_of_box_run_p) 1730 if (it->start_of_box_run_p)
1728 it->pixel_width += face->box_line_width; 1731 it->pixel_width += abs (face->box_line_width);
1729 if (it->end_of_box_run_p) 1732 if (it->end_of_box_run_p)
1730 it->pixel_width += face->box_line_width; 1733 it->pixel_width += abs (face->box_line_width);
1731 } 1734 }
1732 1735
1733 take_vertical_position_into_account (it); 1736 take_vertical_position_into_account (it);
@@ -1934,13 +1937,16 @@ x_produce_stretch_glyph (it)
1934 1937
1935 if (face->box != FACE_NO_BOX) 1938 if (face->box != FACE_NO_BOX)
1936 { 1939 {
1937 it->ascent += face->box_line_width; 1940 if (face->box_line_width > 0)
1938 it->descent += face->box_line_width; 1941 {
1942 it->ascent += face->box_line_width;
1943 it->descent += face->box_line_width;
1944 }
1939 1945
1940 if (it->start_of_box_run_p) 1946 if (it->start_of_box_run_p)
1941 it->pixel_width += face->box_line_width; 1947 it->pixel_width += abs (face->box_line_width);
1942 if (it->end_of_box_run_p) 1948 if (it->end_of_box_run_p)
1943 it->pixel_width += face->box_line_width; 1949 it->pixel_width += abs (face->box_line_width);
1944 } 1950 }
1945 1951
1946 take_vertical_position_into_account (it); 1952 take_vertical_position_into_account (it);
@@ -2098,8 +2104,13 @@ x_produce_glyphs (it)
2098 { 2104 {
2099 int thick = face->box_line_width; 2105 int thick = face->box_line_width;
2100 2106
2101 it->ascent += thick; 2107 if (thick > 0)
2102 it->descent += thick; 2108 {
2109 it->ascent += thick;
2110 it->descent += thick;
2111 }
2112 else
2113 thick = -thick;
2103 2114
2104 if (it->start_of_box_run_p) 2115 if (it->start_of_box_run_p)
2105 it->pixel_width += thick; 2116 it->pixel_width += thick;
@@ -2144,11 +2155,11 @@ x_produce_glyphs (it)
2144 it->ascent = it->phys_ascent = FONT_BASE (font) + boff; 2155 it->ascent = it->phys_ascent = FONT_BASE (font) + boff;
2145 it->descent = it->phys_descent = FONT_DESCENT (font) - boff; 2156 it->descent = it->phys_descent = FONT_DESCENT (font) - boff;
2146 2157
2147 if (face->box != FACE_NO_BOX) 2158 if (face->box != FACE_NO_BOX
2159 && face->box_line_width > 0)
2148 { 2160 {
2149 int thick = face->box_line_width; 2161 it->ascent += face->box_line_width;
2150 it->ascent += thick; 2162 it->descent += face->box_line_width;
2151 it->descent += thick;
2152 } 2163 }
2153 } 2164 }
2154 else if (it->char_to_display == '\t') 2165 else if (it->char_to_display == '\t')
@@ -2220,8 +2231,14 @@ x_produce_glyphs (it)
2220 if (face->box != FACE_NO_BOX) 2231 if (face->box != FACE_NO_BOX)
2221 { 2232 {
2222 int thick = face->box_line_width; 2233 int thick = face->box_line_width;
2223 it->ascent += thick; 2234
2224 it->descent += thick; 2235 if (thick > 0)
2236 {
2237 it->ascent += thick;
2238 it->descent += thick;
2239 }
2240 else
2241 thick = - thick;
2225 2242
2226 if (it->start_of_box_run_p) 2243 if (it->start_of_box_run_p)
2227 it->pixel_width += thick; 2244 it->pixel_width += thick;
@@ -2502,8 +2519,14 @@ x_produce_glyphs (it)
2502 if (face->box != FACE_NO_BOX) 2519 if (face->box != FACE_NO_BOX)
2503 { 2520 {
2504 int thick = face->box_line_width; 2521 int thick = face->box_line_width;
2505 it->ascent += thick; 2522
2506 it->descent += thick; 2523 if (thick > 0)
2524 {
2525 it->ascent += thick;
2526 it->descent += thick;
2527 }
2528 else
2529 thick = - thick;
2507 2530
2508 if (it->start_of_box_run_p) 2531 if (it->start_of_box_run_p)
2509 it->pixel_width += thick; 2532 it->pixel_width += thick;
@@ -2560,7 +2583,8 @@ x_estimate_mode_line_height (f, face_id)
2560 { 2583 {
2561 if (face->font) 2584 if (face->font)
2562 height = FONT_HEIGHT (face->font); 2585 height = FONT_HEIGHT (face->font);
2563 height += 2 * face->box_line_width; 2586 if (face->box_line_width > 0)
2587 height += 2 * face->box_line_width;
2564 } 2588 }
2565 } 2589 }
2566 2590
@@ -3351,29 +3375,31 @@ x_draw_glyph_string_background (s, force_p)
3351 shouldn't be drawn in the first place. */ 3375 shouldn't be drawn in the first place. */
3352 if (!s->background_filled_p) 3376 if (!s->background_filled_p)
3353 { 3377 {
3378 int box_line_width = max (s->face->box_line_width, 0);
3379
3354#if 0 /* TODO: stipple */ 3380#if 0 /* TODO: stipple */
3355 if (s->stippled_p) 3381 if (s->stippled_p)
3356 { 3382 {
3357 /* Fill background with a stipple pattern. */ 3383 /* Fill background with a stipple pattern. */
3358 XSetFillStyle (s->display, s->gc, FillOpaqueStippled); 3384 XSetFillStyle (s->display, s->gc, FillOpaqueStippled);
3359 XFillRectangle (s->display, s->window, s->gc, s->x, 3385 XFillRectangle (s->display, s->window, s->gc, s->x,
3360 s->y + s->face->box_line_width, 3386 s->y + box_line_width,
3361 s->background_width, 3387 s->background_width,
3362 s->height - 2 * s->face->box_line_width); 3388 s->height - 2 * box_line_width);
3363 XSetFillStyle (s->display, s->gc, FillSolid); 3389 XSetFillStyle (s->display, s->gc, FillSolid);
3364 s->background_filled_p = 1; 3390 s->background_filled_p = 1;
3365 } 3391 }
3366 else 3392 else
3367#endif 3393#endif
3368 if (FONT_HEIGHT (s->font) < s->height - 2 * s->face->box_line_width 3394 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width
3369 || s->font_not_found_p 3395 || s->font_not_found_p
3370 || s->extends_to_end_of_line_p 3396 || s->extends_to_end_of_line_p
3371 || s->font->bdf 3397 || s->font->bdf
3372 || force_p) 3398 || force_p)
3373 { 3399 {
3374 x_clear_glyph_string_rect (s, s->x, s->y + s->face->box_line_width, 3400 x_clear_glyph_string_rect (s, s->x, s->y + box_line_width,
3375 s->background_width, 3401 s->background_width,
3376 s->height - 2 * s->face->box_line_width); 3402 s->height - 2 * box_line_width);
3377 s->background_filled_p = 1; 3403 s->background_filled_p = 1;
3378 } 3404 }
3379 } 3405 }
@@ -3393,7 +3419,7 @@ x_draw_glyph_string_foreground (s)
3393 of S to the right of that box line. */ 3419 of S to the right of that box line. */
3394 if (s->face->box != FACE_NO_BOX 3420 if (s->face->box != FACE_NO_BOX
3395 && s->first_glyph->left_box_line_p) 3421 && s->first_glyph->left_box_line_p)
3396 x = s->x + s->face->box_line_width; 3422 x = s->x + abs (s->face->box_line_width);
3397 else 3423 else
3398 x = s->x; 3424 x = s->x;
3399 3425
@@ -3455,7 +3481,7 @@ x_draw_composite_glyph_string_foreground (s)
3455 of S to the right of that box line. */ 3481 of S to the right of that box line. */
3456 if (s->face->box != FACE_NO_BOX 3482 if (s->face->box != FACE_NO_BOX
3457 && s->first_glyph->left_box_line_p) 3483 && s->first_glyph->left_box_line_p)
3458 x = s->x + s->face->box_line_width; 3484 x = s->x + abs (s->face->box_line_width);
3459 else 3485 else
3460 x = s->x; 3486 x = s->x;
3461 3487
@@ -3789,7 +3815,7 @@ x_draw_glyph_string_box (s)
3789 ? s->first_glyph 3815 ? s->first_glyph
3790 : s->first_glyph + s->nchars - 1); 3816 : s->first_glyph + s->nchars - 1);
3791 3817
3792 width = s->face->box_line_width; 3818 width = abs (s->face->box_line_width);
3793 raised_p = s->face->box == FACE_RAISED_BOX; 3819 raised_p = s->face->box == FACE_RAISED_BOX;
3794 left_x = s->x; 3820 left_x = s->x;
3795 right_x = ((s->row->full_width_p 3821 right_x = ((s->row->full_width_p
@@ -3834,7 +3860,7 @@ x_draw_image_foreground (s)
3834 right of that line. */ 3860 right of that line. */
3835 if (s->face->box != FACE_NO_BOX 3861 if (s->face->box != FACE_NO_BOX
3836 && s->first_glyph->left_box_line_p) 3862 && s->first_glyph->left_box_line_p)
3837 x = s->x + s->face->box_line_width; 3863 x = s->x + abs (s->face->box_line_width);
3838 else 3864 else
3839 x = s->x; 3865 x = s->x;
3840 3866
@@ -3936,7 +3962,7 @@ x_draw_image_relief (s)
3936 right of that line. */ 3962 right of that line. */
3937 if (s->face->box != FACE_NO_BOX 3963 if (s->face->box != FACE_NO_BOX
3938 && s->first_glyph->left_box_line_p) 3964 && s->first_glyph->left_box_line_p)
3939 x = s->x + s->face->box_line_width; 3965 x = s->x + abs (s->face->box_line_width);
3940 else 3966 else
3941 x = s->x; 3967 x = s->x;
3942 3968
@@ -3984,7 +4010,7 @@ w32_draw_image_foreground_1 (s, pixmap)
3984 right of that line. */ 4010 right of that line. */
3985 if (s->face->box != FACE_NO_BOX 4011 if (s->face->box != FACE_NO_BOX
3986 && s->first_glyph->left_box_line_p) 4012 && s->first_glyph->left_box_line_p)
3987 x = s->face->box_line_width; 4013 x = abs (s->face->box_line_width);
3988 else 4014 else
3989 x = 0; 4015 x = 0;
3990 4016
@@ -4102,11 +4128,12 @@ x_draw_image_glyph_string (s)
4102 struct glyph_string *s; 4128 struct glyph_string *s;
4103{ 4129{
4104 int x, y; 4130 int x, y;
4105 int box_line_width = s->face->box_line_width; 4131 int box_line_hwidth = abs (s->face->box_line_width);
4132 int box_line_vwidth = max (s->face->box_line_width, 0);
4106 int height; 4133 int height;
4107 HBITMAP pixmap = 0; 4134 HBITMAP pixmap = 0;
4108 4135
4109 height = s->height - 2 * box_line_width; 4136 height = s->height - 2 * box_line_vwidth;
4110 4137
4111 /* Fill background with face under the image. Do it only if row is 4138 /* Fill background with face under the image. Do it only if row is
4112 taller than image or if image has a clip mask to reduce 4139 taller than image or if image has a clip mask to reduce
@@ -4121,12 +4148,12 @@ x_draw_image_glyph_string (s)
4121 || s->img->pixmap == 0 4148 || s->img->pixmap == 0
4122 || s->width != s->background_width) 4149 || s->width != s->background_width)
4123 { 4150 {
4124 if (box_line_width && s->first_glyph->left_box_line_p) 4151 if (box_line_hwidth && s->first_glyph->left_box_line_p)
4125 x = s->x + box_line_width; 4152 x = s->x + box_line_hwidth;
4126 else 4153 else
4127 x = s->x; 4154 x = s->x;
4128 4155
4129 y = s->y + box_line_width; 4156 y = s->y + box_line_vwidth;
4130#if 0 /* TODO: image mask */ 4157#if 0 /* TODO: image mask */
4131 if (s->img->mask) 4158 if (s->img->mask)
4132 { 4159 {