Mercurial > emacs
comparison src/xdisp.c @ 54142:5a9638c2c889
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-114
Merge some minor redisplay bug-fixes from emacs--tiling--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-9
Remove bogus xassert
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-10
Avoid negative descents for images with ascent > height
* miles@gnu.org--gnu-2004/emacs--tiling--0--patch-13
Fix iterator-inconsistency bug in redisplay
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 25 Feb 2004 12:54:16 +0000 |
parents | 4dcd34f2c3a7 |
children | 02b649742717 |
comparison
equal
deleted
inserted
replaced
54141:8e0088433ac7 | 54142:5a9638c2c889 |
---|---|
1902 if (it->method == next_element_from_string) | 1902 if (it->method == next_element_from_string) |
1903 { | 1903 { |
1904 xassert (STRINGP (it->string)); | 1904 xassert (STRINGP (it->string)); |
1905 xassert (IT_STRING_CHARPOS (*it) >= 0); | 1905 xassert (IT_STRING_CHARPOS (*it) >= 0); |
1906 } | 1906 } |
1907 else if (it->method == next_element_from_buffer) | 1907 else |
1908 { | 1908 { |
1909 /* Check that character and byte positions agree. */ | 1909 xassert (IT_STRING_CHARPOS (*it) < 0); |
1910 xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); | 1910 if (it->method == next_element_from_buffer) |
1911 { | |
1912 /* Check that character and byte positions agree. */ | |
1913 xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); | |
1914 } | |
1911 } | 1915 } |
1912 | 1916 |
1913 if (it->dpvec) | 1917 if (it->dpvec) |
1914 xassert (it->current.dpvec_index >= 0); | 1918 xassert (it->current.dpvec_index >= 0); |
1915 else | 1919 else |
2018 /* Clear IT. */ | 2022 /* Clear IT. */ |
2019 bzero (it, sizeof *it); | 2023 bzero (it, sizeof *it); |
2020 it->current.overlay_string_index = -1; | 2024 it->current.overlay_string_index = -1; |
2021 it->current.dpvec_index = -1; | 2025 it->current.dpvec_index = -1; |
2022 it->base_face_id = base_face_id; | 2026 it->base_face_id = base_face_id; |
2027 it->string = Qnil; | |
2028 IT_STRING_CHARPOS (*it) = IT_STRING_BYTEPOS (*it) = -1; | |
2023 | 2029 |
2024 /* The window in which we iterate over current_buffer: */ | 2030 /* The window in which we iterate over current_buffer: */ |
2025 XSETWINDOW (it->window, w); | 2031 XSETWINDOW (it->window, w); |
2026 it->w = w; | 2032 it->w = w; |
2027 it->f = XFRAME (w->frame); | 2033 it->f = XFRAME (w->frame); |
17682 prepare_image_for_display (it->f, img); | 17688 prepare_image_for_display (it->f, img); |
17683 | 17689 |
17684 it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); | 17690 it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); |
17685 it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; | 17691 it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; |
17686 it->pixel_width = img->width + 2 * img->hmargin; | 17692 it->pixel_width = img->width + 2 * img->hmargin; |
17693 | |
17694 /* It's quite possible for images to have an ascent greater than | |
17695 their height, so don't get confused in that case. */ | |
17696 if (it->descent < 0) | |
17697 it->descent = 0; | |
17687 | 17698 |
17688 /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ | 17699 /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ |
17689 face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); | 17700 face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); |
17690 if (face_ascent > it->ascent) | 17701 if (face_ascent > it->ascent) |
17691 it->ascent = it->phys_ascent = face_ascent; | 17702 it->ascent = it->phys_ascent = face_ascent; |