{
/* Mode lines, menu bar in terminal frames. */
it->first_visible_x = 0;
- it->last_visible_x = body_width = WINDOW_PIXEL_WIDTH (w);
+ it->last_visible_x =
+ WINDOW_PIXEL_WIDTH (w) - WINDOW_RIGHT_DIVIDER_WIDTH (w);
}
else
{
face = FACE_FROM_ID_OR_NULL (it->f, remapped_base_face_id);
if (face && face->box != FACE_NO_BOX)
{
+ int box_thickness = face->box_vertical_line_width;
it->face_box_p = true;
it->start_of_box_run_p = true;
+ /* Make sure we will have enough horizontal space to add the
+ right box line at the end. */
+ if (box_thickness > 0)
+ it->last_visible_x -= box_thickness;
}
}
/* Insert the stretch glyph. */
it->object = list3 (Qspace, QCwidth, w);
produce_stretch_glyph (it);
+ if (it->area == TEXT_AREA)
+ it->current_x += it->pixel_width;
it->min_width_property = Qnil;
}
}
{
struct glyph *last = (it.glyph_row->glyphs[TEXT_AREA]
+ it.glyph_row->used[TEXT_AREA] - 1);
+ int box_thickness = face->box_vertical_line_width;
last->right_box_line_p = true;
+ /* Add back the space for the right box line we subtracted in
+ init_iterator, since the right_box_line_p flag will make the
+ glyph wider. We actually add only as much space as is
+ available for the last glyph of the modeline and whatever
+ space is left beyond it, since that glyph could be only
+ partially visible */
+ if (box_thickness > 0)
+ last->pixel_width += max (0, (box_thickness
+ - (it.current_x - it.last_visible_x)));
}
return it.glyph_row->height;