+2001-07-27 Gerd Moellmann <gerd@gnu.org>
+
+ * xterm.c (x_get_glyph_string_clip_rect): Minor cleanup.
+
+ * dispnew.c (shift_glyph_matrix, blank_row): Fix computation
+ of row's visible height.
+
+ * xdisp.c (init_from_display_pos): If POS is in an overlay string,
+ deal with the first overlay string having an image `display'
+ property.
+ (try_window_reusing_current_matrix, compute_line_metrics): Fix
+ computation of row's visible height for the case that part of the
+ row is invisible above and part of the row is at the same time
+ invisible below the window.
+
2001-07-26 Gerd Moellmann <gerd@gnu.org>
* xfns.c (x-show-tip): Doc fix.
after-string. */
init_iterator (it, w, charpos, bytepos, NULL, DEFAULT_FACE_ID);
- /* If position is within an overlay string, set up IT to
- the right overlay string. */
+ /* If position is within an overlay string, set up IT to the right
+ overlay string. */
if (pos->overlay_string_index >= 0)
{
int relative_index;
+
+ /* If the first overlay string happens to have a `display'
+ property for an image, the iterator will be set up for that
+ image, and we have to undo that setup first before we can
+ correct the overlay string index. */
+ if (it->method == next_element_from_image)
+ pop_it (it);
/* We already have the first chunk of overlay strings in
IT->overlay_strings. Load more until the one for
struct glyph_row *last_reused_text_row;
struct glyph_row *start_row;
int start_vpos, min_y, max_y;
-
+
if (/* This function doesn't handle terminal frames. */
!FRAME_WINDOW_P (f)
/* Don't try to reuse the display if windows have been split
++row)
{
row->y = it.current_y;
+ row->visible_height = row->height;
if (row->y < min_y)
- row->visible_height = row->height - (min_y - row->y);
- else if (row->y + row->height > max_y)
- row->visible_height
- = row->height - (row->y + row->height - max_y);
- else
- row->visible_height = row->height;
+ row->visible_height -= min_y - row->y;
+ if (row->y + row->height > max_y)
+ row->visible_height -= row->y + row->height - max_y;
it.current_y += row->height;
for (row = first_reusable_row; row < first_row_to_display; ++row)
{
row->y -= dy;
+ row->visible_height = row->height;
if (row->y < min_y)
- row->visible_height = row->height - (min_y - row->y);
- else if (row->y + row->height > max_y)
- row->visible_height
- = row->height - (row->y + row->height - max_y);
- else
- row->visible_height = row->height;
+ row->visible_height -= min_y - row->y;
+ if (row->y + row->height > max_y)
+ row->visible_height -= row->y + row->height - max_y;
}
/* Scroll the current matrix. */
if (FRAME_WINDOW_P (it->f))
{
- int i, header_line_height;
+ int i, min_y, max_y;
/* The line may consist of one space only, that was added to
place the cursor on it. If so, the row's height hasn't been
/* Compute how much of the line is visible. */
row->visible_height = row->height;
- header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (it->w);
- if (row->y < header_line_height)
- row->visible_height -= header_line_height - row->y;
- else
- {
- int max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (it->w);
- if (row->y + row->height > max_y)
- row->visible_height -= row->y + row->height - max_y;
- }
+ min_y = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (it->w);
+ max_y = WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE (it->w);
+
+ if (row->y < min_y)
+ row->visible_height -= min_y - row->y;
+ if (row->y + row->height > max_y)
+ row->visible_height -= row->y + row->height - max_y;
}
else
{