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/macterm.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/macterm.c')
| -rw-r--r-- | src/macterm.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/macterm.c b/src/macterm.c index 60eee6a4a84..9304a2d62f9 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -4731,29 +4731,10 @@ x_draw_hollow_cursor (w, row) | |||
| 4731 | if (cursor_glyph == NULL) | 4731 | if (cursor_glyph == NULL) |
| 4732 | return; | 4732 | return; |
| 4733 | 4733 | ||
| 4734 | /* Compute the width of the rectangle to draw. If on a stretch | 4734 | /* Compute frame-relative coordinates for phys cursor. */ |
| 4735 | glyph, and `x-stretch-block-cursor' is nil, don't draw a | ||
| 4736 | rectangle as wide as the glyph, but use a canonical character | ||
| 4737 | width instead. */ | ||
| 4738 | wd = cursor_glyph->pixel_width - 1; | ||
| 4739 | if (cursor_glyph->type == STRETCH_GLYPH | ||
| 4740 | && !x_stretch_cursor_p) | ||
| 4741 | wd = min (FRAME_COLUMN_WIDTH (f), wd); | ||
| 4742 | w->phys_cursor_width = wd; | ||
| 4743 | |||
| 4744 | /* Compute frame-relative coordinates from window-relative | ||
| 4745 | coordinates. */ | ||
| 4746 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | 4735 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
| 4747 | y = WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y); | 4736 | y = get_phys_cursor_geometry (w, row, cursor_glyph, &h); |
| 4748 | 4737 | wd = w->phys_cursor_width; | |
| 4749 | /* Compute the proper height and ascent of the rectangle, based | ||
| 4750 | on the actual glyph. Using the full height of the row looks | ||
| 4751 | bad when there are tall images on that row. */ | ||
| 4752 | h = max (min (FRAME_LINE_HEIGHT (f), row->height), | ||
| 4753 | cursor_glyph->ascent + cursor_glyph->descent); | ||
| 4754 | if (h < row->height) | ||
| 4755 | y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; | ||
| 4756 | h--; | ||
| 4757 | 4738 | ||
| 4758 | /* The foreground of cursor_gc is typically the same as the normal | 4739 | /* The foreground of cursor_gc is typically the same as the normal |
| 4759 | background color, which can cause the cursor box to be invisible. */ | 4740 | background color, which can cause the cursor box to be invisible. */ |