7150 |
window_box (w, area, &window_x, &window_y, &window_width, 0); |
window_box (w, area, &window_x, &window_y, &window_width, 0); |
7151 |
|
|
7152 |
clip_rect.x = window_x; |
clip_rect.x = window_x; |
7153 |
clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
clip_rect.y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, row->y)); |
7154 |
clip_rect.y = max (clip_rect.y, window_y); |
clip_rect.y = max (clip_rect.y, window_y); |
7155 |
clip_rect.width = window_width; |
clip_rect.width = window_width; |
7156 |
clip_rect.height = row->visible_height; |
clip_rect.height = row->visible_height; |
7180 |
if (cursor_glyph == NULL) |
if (cursor_glyph == NULL) |
7181 |
return; |
return; |
7182 |
|
|
7183 |
/* Compute the width of the rectangle to draw. If on a stretch |
/* Compute frame-relative coordinates for phys cursor. */ |
|
glyph, and `x-stretch-block-cursor' is nil, don't draw a |
|
|
rectangle as wide as the glyph, but use a canonical character |
|
|
width instead. */ |
|
|
wd = cursor_glyph->pixel_width - 1; |
|
|
if (cursor_glyph->type == STRETCH_GLYPH |
|
|
&& !x_stretch_cursor_p) |
|
|
wd = min (FRAME_COLUMN_WIDTH (f), wd); |
|
|
w->phys_cursor_width = wd; |
|
|
|
|
|
/* Compute frame-relative coordinates from window-relative |
|
|
coordinates. */ |
|
7184 |
x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
7185 |
y = WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y); |
y = get_phys_cursor_geometry (w, row, cursor_glyph, &h); |
7186 |
|
wd = w->phys_cursor_width; |
|
/* Compute the proper height and ascent of the rectangle, based |
|
|
on the actual glyph. Using the full height of the row looks |
|
|
bad when there are tall images on that row. */ |
|
|
h = max (min (FRAME_LINE_HEIGHT (f), row->height), |
|
|
cursor_glyph->ascent + cursor_glyph->descent); |
|
|
if (h < row->height) |
|
|
y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; |
|
|
h--; |
|
7187 |
|
|
7188 |
/* The foreground of cursor_gc is typically the same as the normal |
/* The foreground of cursor_gc is typically the same as the normal |
7189 |
background color, which can cause the cursor box to be invisible. */ |
background color, which can cause the cursor box to be invisible. */ |