diff options
author | Andrew Innes <andrewi@gnu.org> | 2001-02-12 14:50:08 +0000 |
---|---|---|
committer | Andrew Innes <andrewi@gnu.org> | 2001-02-12 14:50:08 +0000 |
commit | 60222d69c6d0c46532c9f1f7824f2c7c992da39e (patch) | |
tree | a93a6c6915c6355b9179d1c740366eb59737d775 | |
parent | 6c542587e5679ea7a3ea47190675ce419a4f0095 (diff) | |
download | emacs-60222d69c6d0c46532c9f1f7824f2c7c992da39e.tar.gz |
(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.
-rw-r--r-- | src/ChangeLog | 19 | ||||
-rw-r--r-- | src/w32term.c | 97 |
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 @@ +2001-02-12 Andrew Innes <andrewi@gnu.org> + + The following changes are to draw box lines inside characters area + if line-width is negative. + + * w32term.c (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. + 2001-02-09 Kenichi Handa <handa@etl.go.jp> 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) if (face->box != FACE_NO_BOX) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + if (face->box_line_width > 0) + { + it->ascent += face->box_line_width; + it->descent += face->box_line_width; + } if (it->start_of_box_run_p) - it->pixel_width += face->box_line_width; + it->pixel_width += abs (face->box_line_width); if (it->end_of_box_run_p) - it->pixel_width += face->box_line_width; + it->pixel_width += abs (face->box_line_width); } take_vertical_position_into_account (it); @@ -1934,13 +1937,16 @@ x_produce_stretch_glyph (it) if (face->box != FACE_NO_BOX) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + if (face->box_line_width > 0) + { + it->ascent += face->box_line_width; + it->descent += face->box_line_width; + } if (it->start_of_box_run_p) - it->pixel_width += face->box_line_width; + it->pixel_width += abs (face->box_line_width); if (it->end_of_box_run_p) - it->pixel_width += face->box_line_width; + it->pixel_width += abs (face->box_line_width); } take_vertical_position_into_account (it); @@ -2098,8 +2104,13 @@ x_produce_glyphs (it) { int thick = face->box_line_width; - it->ascent += thick; - it->descent += thick; + if (thick > 0) + { + it->ascent += thick; + it->descent += thick; + } + else + thick = -thick; if (it->start_of_box_run_p) it->pixel_width += thick; @@ -2144,11 +2155,11 @@ x_produce_glyphs (it) it->ascent = it->phys_ascent = FONT_BASE (font) + boff; it->descent = it->phys_descent = FONT_DESCENT (font) - boff; - if (face->box != FACE_NO_BOX) + if (face->box != FACE_NO_BOX + && face->box_line_width > 0) { - int thick = face->box_line_width; - it->ascent += thick; - it->descent += thick; + it->ascent += face->box_line_width; + it->descent += face->box_line_width; } } else if (it->char_to_display == '\t') @@ -2220,8 +2231,14 @@ x_produce_glyphs (it) if (face->box != FACE_NO_BOX) { int thick = face->box_line_width; - it->ascent += thick; - it->descent += thick; + + if (thick > 0) + { + it->ascent += thick; + it->descent += thick; + } + else + thick = - thick; if (it->start_of_box_run_p) it->pixel_width += thick; @@ -2502,8 +2519,14 @@ x_produce_glyphs (it) if (face->box != FACE_NO_BOX) { int thick = face->box_line_width; - it->ascent += thick; - it->descent += thick; + + if (thick > 0) + { + it->ascent += thick; + it->descent += thick; + } + else + thick = - thick; if (it->start_of_box_run_p) it->pixel_width += thick; @@ -2560,7 +2583,8 @@ x_estimate_mode_line_height (f, face_id) { if (face->font) height = FONT_HEIGHT (face->font); - height += 2 * face->box_line_width; + if (face->box_line_width > 0) + height += 2 * face->box_line_width; } } @@ -3351,29 +3375,31 @@ x_draw_glyph_string_background (s, force_p) shouldn't be drawn in the first place. */ if (!s->background_filled_p) { + int box_line_width = max (s->face->box_line_width, 0); + #if 0 /* TODO: stipple */ if (s->stippled_p) { /* Fill background with a stipple pattern. */ XSetFillStyle (s->display, s->gc, FillOpaqueStippled); XFillRectangle (s->display, s->window, s->gc, s->x, - s->y + s->face->box_line_width, + s->y + box_line_width, s->background_width, - s->height - 2 * s->face->box_line_width); + s->height - 2 * box_line_width); XSetFillStyle (s->display, s->gc, FillSolid); s->background_filled_p = 1; } else #endif - if (FONT_HEIGHT (s->font) < s->height - 2 * s->face->box_line_width + if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width || s->font_not_found_p || s->extends_to_end_of_line_p || s->font->bdf || force_p) { - x_clear_glyph_string_rect (s, s->x, s->y + s->face->box_line_width, + x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, s->background_width, - s->height - 2 * s->face->box_line_width); + s->height - 2 * box_line_width); s->background_filled_p = 1; } } @@ -3393,7 +3419,7 @@ x_draw_glyph_string_foreground (s) of S to the right of that box line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + s->face->box_line_width; + x = s->x + abs (s->face->box_line_width); else x = s->x; @@ -3455,7 +3481,7 @@ x_draw_composite_glyph_string_foreground (s) of S to the right of that box line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + s->face->box_line_width; + x = s->x + abs (s->face->box_line_width); else x = s->x; @@ -3789,7 +3815,7 @@ x_draw_glyph_string_box (s) ? s->first_glyph : s->first_glyph + s->nchars - 1); - width = s->face->box_line_width; + width = abs (s->face->box_line_width); raised_p = s->face->box == FACE_RAISED_BOX; left_x = s->x; right_x = ((s->row->full_width_p @@ -3834,7 +3860,7 @@ x_draw_image_foreground (s) right of that line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + s->face->box_line_width; + x = s->x + abs (s->face->box_line_width); else x = s->x; @@ -3936,7 +3962,7 @@ x_draw_image_relief (s) right of that line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->x + s->face->box_line_width; + x = s->x + abs (s->face->box_line_width); else x = s->x; @@ -3984,7 +4010,7 @@ w32_draw_image_foreground_1 (s, pixmap) right of that line. */ if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) - x = s->face->box_line_width; + x = abs (s->face->box_line_width); else x = 0; @@ -4102,11 +4128,12 @@ x_draw_image_glyph_string (s) struct glyph_string *s; { int x, y; - int box_line_width = s->face->box_line_width; + int box_line_hwidth = abs (s->face->box_line_width); + int box_line_vwidth = max (s->face->box_line_width, 0); int height; HBITMAP pixmap = 0; - height = s->height - 2 * box_line_width; + height = s->height - 2 * box_line_vwidth; /* Fill background with face under the image. Do it only if row is taller than image or if image has a clip mask to reduce @@ -4121,12 +4148,12 @@ x_draw_image_glyph_string (s) || s->img->pixmap == 0 || s->width != s->background_width) { - if (box_line_width && s->first_glyph->left_box_line_p) - x = s->x + box_line_width; + if (box_line_hwidth && s->first_glyph->left_box_line_p) + x = s->x + box_line_hwidth; else x = s->x; - y = s->y + box_line_width; + y = s->y + box_line_vwidth; #if 0 /* TODO: image mask */ if (s->img->mask) { |