aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2005-01-27 22:34:05 +0000
committerKim F. Storm2005-01-27 22:34:05 +0000
commitdbd8ee19133e033e98ced28b52bd05eaf1e19dda (patch)
tree6a73cbe36a56ceb79f8dc9058fed1752690ccb21 /src
parent2049265a5b75d5d5b4899116c27dfaafdbcd13e3 (diff)
downloademacs-dbd8ee19133e033e98ced28b52bd05eaf1e19dda.tar.gz
emacs-dbd8ee19133e033e98ced28b52bd05eaf1e19dda.zip
(x_clip_to_row): Ensure y >= 0.
(x_draw_hollow_cursor): Use get_phys_cursor_geometry.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 49e635c0fa3..2db3379a264 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7150,7 +7150,7 @@ x_clip_to_row (w, row, area, gc)
7150 window_box (w, area, &window_x, &window_y, &window_width, 0); 7150 window_box (w, area, &window_x, &window_y, &window_width, 0);
7151 7151
7152 clip_rect.x = window_x; 7152 clip_rect.x = window_x;
7153 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); 7153 clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, row->y));
7154 clip_rect.y = max (clip_rect.y, window_y); 7154 clip_rect.y = max (clip_rect.y, window_y);
7155 clip_rect.width = window_width; 7155 clip_rect.width = window_width;
7156 clip_rect.height = row->visible_height; 7156 clip_rect.height = row->visible_height;
@@ -7180,29 +7180,10 @@ x_draw_hollow_cursor (w, row)
7180 if (cursor_glyph == NULL) 7180 if (cursor_glyph == NULL)
7181 return; 7181 return;
7182 7182
7183 /* Compute the width of the rectangle to draw. If on a stretch 7183 /* Compute frame-relative coordinates for phys cursor. */
7184 glyph, and `x-stretch-block-cursor' is nil, don't draw a
7185 rectangle as wide as the glyph, but use a canonical character
7186 width instead. */
7187 wd = cursor_glyph->pixel_width - 1;
7188 if (cursor_glyph->type == STRETCH_GLYPH
7189 && !x_stretch_cursor_p)
7190 wd = min (FRAME_COLUMN_WIDTH (f), wd);
7191 w->phys_cursor_width = wd;
7192
7193 /* Compute frame-relative coordinates from window-relative
7194 coordinates. */
7195 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 7184 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
7196 y = WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y); 7185 y = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
7197 7186 wd = w->phys_cursor_width;
7198 /* Compute the proper height and ascent of the rectangle, based
7199 on the actual glyph. Using the full height of the row looks
7200 bad when there are tall images on that row. */
7201 h = max (min (FRAME_LINE_HEIGHT (f), row->height),
7202 cursor_glyph->ascent + cursor_glyph->descent);
7203 if (h < row->height)
7204 y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h;
7205 h--;
7206 7187
7207 /* The foreground of cursor_gc is typically the same as the normal 7188 /* The foreground of cursor_gc is typically the same as the normal
7208 background color, which can cause the cursor box to be invisible. */ 7189 background color, which can cause the cursor box to be invisible. */