diff options
Diffstat (limited to 'src/w32term.c')
-rw-r--r-- | src/w32term.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/src/w32term.c b/src/w32term.c index b564ed3bd2b..2870955b94f 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -91,6 +91,10 @@ static Lisp_Object last_window; (Not yet supported, see TODO in x_draw_glyph_string.) */ int x_use_underline_position_properties; +/* Non-zero means to draw the underline at the same place as the descent line. */ + +int x_underline_at_descent_line; + extern unsigned int msh_mousewheel; extern void free_frame_menubar (); @@ -2418,7 +2422,9 @@ x_draw_stretch_glyph_string (s) int background_width = s->background_width; int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); - if (x < left_x) + /* Don't draw into left margin, fringe or scrollbar area + except for header line and mode line. */ + if (x < left_x && !s->row->mode_line_p) { background_width -= left_x - x; x = left_x; @@ -2507,21 +2513,27 @@ x_draw_glyph_string (s) && (s->font->bdf || !s->font->tm.tmUnderlined)) { unsigned long h = 1; - unsigned long dy = s->height - h; + unsigned long dy = 0; - /* TODO: Use font information for positioning and thickness - of underline. See OUTLINETEXTMETRIC, and xterm.c. - Note: If you make this work, don't forget to change the - doc string of x-use-underline-position-properties below. */ + if (x_underline_at_descent_line) + dy = s->height - h; + else + { + /* TODO: Use font information for positioning and thickness of + underline. See OUTLINETEXTMETRIC, and xterm.c. Note: If + you make this work, don't forget to change the doc string of + x-use-underline-position-properties below. */ + dy = s->height - h; + } if (s->face->underline_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, - s->y + dy, s->width, 1); + s->y + dy, s->background_width, 1); } else { w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, - s->y + dy, s->width, 1); + s->y + dy, s->background_width, 1); } } @@ -2533,12 +2545,12 @@ x_draw_glyph_string (s) if (s->face->overline_color_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, - s->y + dy, s->width, h); + s->y + dy, s->background_width, h); } else { w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x, - s->y + dy, s->width, h); + s->y + dy, s->background_width, h); } } @@ -6509,6 +6521,14 @@ to 4.1, set this to nil. NOTE: Not supported on MS-Windows yet. */); x_use_underline_position_properties = 0; + DEFVAR_BOOL ("x-underline-at-descent-line", + &x_underline_at_descent_line, + doc: /* *Non-nil means to draw the underline at the same place as the descent line. +nil means to draw the underline according to the value of the variable +`x-use-underline-position-properties', which is usually at the baseline +level. The default value is nil. */); + x_underline_at_descent_line = 0; + DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, doc: /* If not nil, Emacs uses toolkit scroll bars. */); Vx_toolkit_scroll_bars = Qt; |