diff options
| author | Kim F. Storm | 2005-01-27 22:33:39 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-27 22:33:39 +0000 |
| commit | 4d91ce74c7a8eb5a2edca77925f2999bf2acd23d (patch) | |
| tree | 1144df3d6bb8ea5d4fa27c11a7ef0835db6b6c5f /src/w32term.c | |
| parent | 4f5d66403882708ed3a2fc45db6bd39c2c7e760e (diff) | |
| download | emacs-4d91ce74c7a8eb5a2edca77925f2999bf2acd23d.tar.gz emacs-4d91ce74c7a8eb5a2edca77925f2999bf2acd23d.zip | |
(x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/src/w32term.c b/src/w32term.c index 838e1f57222..738f676ceaf 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -4937,7 +4937,7 @@ x_draw_hollow_cursor (w, row) | |||
| 4937 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 4937 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 4938 | HDC hdc; | 4938 | HDC hdc; |
| 4939 | RECT rect; | 4939 | RECT rect; |
| 4940 | int wd, h; | 4940 | int h; |
| 4941 | struct glyph *cursor_glyph; | 4941 | struct glyph *cursor_glyph; |
| 4942 | HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); | 4942 | HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); |
| 4943 | 4943 | ||
| @@ -4947,34 +4947,12 @@ x_draw_hollow_cursor (w, row) | |||
| 4947 | if (cursor_glyph == NULL) | 4947 | if (cursor_glyph == NULL) |
| 4948 | return; | 4948 | return; |
| 4949 | 4949 | ||
| 4950 | /* Compute frame-relative coordinates from window-relative | 4950 | /* Compute frame-relative coordinates for phys cursor. */ |
| 4951 | coordinates. */ | ||
| 4952 | rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | 4951 | rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
| 4953 | rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) | 4952 | rect.top = get_phys_cursor_geometry (w, row, cursor_glyph, &h); |
| 4954 | + row->ascent - w->phys_cursor_ascent); | ||
| 4955 | |||
| 4956 | /* Compute the proper height and ascent of the rectangle, based | ||
| 4957 | on the actual glyph. Using the full height of the row looks | ||
| 4958 | bad when there are tall images on that row. */ | ||
| 4959 | h = max (min (FRAME_LINE_HEIGHT (f), row->height), | ||
| 4960 | cursor_glyph->ascent + cursor_glyph->descent); | ||
| 4961 | if (h < row->height) | ||
| 4962 | rect.top += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; | ||
| 4963 | h--; | ||
| 4964 | |||
| 4965 | rect.bottom = rect.top + h; | 4953 | rect.bottom = rect.top + h; |
| 4954 | rect.right = rect.left + w->phys_cursor_width; | ||
| 4966 | 4955 | ||
| 4967 | /* Compute the width of the rectangle to draw. If on a stretch | ||
| 4968 | glyph, and `x-stretch-block-cursor' is nil, don't draw a | ||
| 4969 | rectangle as wide as the glyph, but use a canonical character | ||
| 4970 | width instead. */ | ||
| 4971 | wd = cursor_glyph->pixel_width; /* TODO: Why off by one compared with X? */ | ||
| 4972 | if (cursor_glyph->type == STRETCH_GLYPH | ||
| 4973 | && !x_stretch_cursor_p) | ||
| 4974 | wd = min (FRAME_COLUMN_WIDTH (f), wd); | ||
| 4975 | w->phys_cursor_width = wd; | ||
| 4976 | |||
| 4977 | rect.right = rect.left + wd; | ||
| 4978 | hdc = get_frame_dc (f); | 4956 | hdc = get_frame_dc (f); |
| 4979 | /* Set clipping, draw the rectangle, and reset clipping again. */ | 4957 | /* Set clipping, draw the rectangle, and reset clipping again. */ |
| 4980 | w32_clip_to_row (w, row, TEXT_AREA, hdc); | 4958 | w32_clip_to_row (w, row, TEXT_AREA, hdc); |