aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-11-18 23:56:52 +0000
committerGerd Moellmann2000-11-18 23:56:52 +0000
commit6d950f4cb0638638cdcd3c6f60ec96058499015c (patch)
treeb8cd7f97dd6388d30d4fee9dc1be82462ed98626
parentfb3cd89b5f1b6ec5d72c1202a961948d8575cc52 (diff)
downloademacs-6d950f4cb0638638cdcd3c6f60ec96058499015c.tar.gz
emacs-6d950f4cb0638638cdcd3c6f60ec96058499015c.zip
(update_text_area): Fix last change.
-rw-r--r--src/ChangeLog4
-rw-r--r--src/dispnew.c71
2 files changed, 43 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 20f2f1d6345..2ac749849c8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12000-11-19 Gerd Moellmann <gerd@gnu.org>
2
3 * dispnew.c (update_text_area): Fix last change.
4
12000-11-18 Gerd Moellmann <gerd@gnu.org> 52000-11-18 Gerd Moellmann <gerd@gnu.org>
2 6
3 * xdisp.c: Use BINDING_STACK_SIZE throughout. 7 * xdisp.c: Use BINDING_STACK_SIZE throughout.
diff --git a/src/dispnew.c b/src/dispnew.c
index 8e8f6c5b437..39d2408a4f7 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3996,7 +3996,7 @@ update_text_area (w, vpos)
3996 3996
3997 while (i < stop) 3997 while (i < stop)
3998 { 3998 {
3999 int skip_equal_glyphs_p = 1; 3999 int can_skip_p = 1;
4000 4000
4001 /* Skip over glyphs that both rows have in common. These 4001 /* Skip over glyphs that both rows have in common. These
4002 don't have to be written. We can't skip if the last 4002 don't have to be written. We can't skip if the last
@@ -4013,38 +4013,42 @@ update_text_area (w, vpos)
4013 4013
4014 rif->get_glyph_overhangs (glyph, XFRAME (w->frame), 4014 rif->get_glyph_overhangs (glyph, XFRAME (w->frame),
4015 &left, &right); 4015 &left, &right);
4016 skip_equal_glyphs_p = right == 0; 4016 can_skip_p = right == 0;
4017 } 4017 }
4018 4018
4019 if (skip_equal_glyphs_p) 4019 if (can_skip_p)
4020 while (i < stop
4021 && GLYPH_EQUAL_P (desired_glyph, current_glyph))
4022 {
4023 x += desired_glyph->pixel_width;
4024 ++desired_glyph, ++current_glyph, ++i;
4025 }
4026
4027 /* Consider the case that the current row contains "xxx ppp
4028 ggg" in italic Courier font, and the desired row is "xxx
4029 ggg". The character `p' has lbearing, `g' has not. The
4030 loop above will stop in front of the first `p' in the
4031 current row. If we would start writing glyphs there, we
4032 wouldn't erase the lbearing of the `p'. The rest of the
4033 lbearing problem is then taken care of by x_draw_glyphs. */
4034 if (overlapping_glyphs_p
4035 && i > 0
4036 && i < current_row->used[TEXT_AREA]
4037 && current_row->used[TEXT_AREA] != desired_row->used[TEXT_AREA])
4038 { 4020 {
4039 int left, right; 4021 while (i < stop
4040 4022 && GLYPH_EQUAL_P (desired_glyph, current_glyph))
4041 rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame),
4042 &left, &right);
4043 while (left > 0 && i > 0)
4044 { 4023 {
4045 --i, --desired_glyph, --current_glyph; 4024 x += desired_glyph->pixel_width;
4046 x -= desired_glyph->pixel_width; 4025 ++desired_glyph, ++current_glyph, ++i;
4047 left -= desired_glyph->pixel_width; 4026 }
4027
4028 /* Consider the case that the current row contains "xxx
4029 ppp ggg" in italic Courier font, and the desired row
4030 is "xxx ggg". The character `p' has lbearing, `g'
4031 has not. The loop above will stop in front of the
4032 first `p' in the current row. If we would start
4033 writing glyphs there, we wouldn't erase the lbearing
4034 of the `p'. The rest of the lbearing problem is then
4035 taken care of by x_draw_glyphs. */
4036 if (overlapping_glyphs_p
4037 && i > 0
4038 && i < current_row->used[TEXT_AREA]
4039 && (current_row->used[TEXT_AREA]
4040 != desired_row->used[TEXT_AREA]))
4041 {
4042 int left, right;
4043
4044 rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame),
4045 &left, &right);
4046 while (left > 0 && i > 0)
4047 {
4048 --i, --desired_glyph, --current_glyph;
4049 x -= desired_glyph->pixel_width;
4050 left -= desired_glyph->pixel_width;
4051 }
4048 } 4052 }
4049 } 4053 }
4050 4054
@@ -4057,15 +4061,18 @@ update_text_area (w, vpos)
4057 int start_x = x, start_hpos = i; 4061 int start_x = x, start_hpos = i;
4058 struct glyph *start = desired_glyph; 4062 struct glyph *start = desired_glyph;
4059 int current_x = x; 4063 int current_x = x;
4060 4064 int skip_first_p = !can_skip_p;
4065
4061 /* Find the next glyph that's equal again. */ 4066 /* Find the next glyph that's equal again. */
4062 while (i < stop 4067 while (i < stop
4063 && !GLYPH_EQUAL_P (desired_glyph, current_glyph) 4068 && (skip_first_p
4069 || !GLYPH_EQUAL_P (desired_glyph, current_glyph))
4064 && x == current_x) 4070 && x == current_x)
4065 { 4071 {
4066 x += desired_glyph->pixel_width; 4072 x += desired_glyph->pixel_width;
4067 current_x += current_glyph->pixel_width; 4073 current_x += current_glyph->pixel_width;
4068 ++desired_glyph, ++current_glyph, ++i; 4074 ++desired_glyph, ++current_glyph, ++i;
4075 skip_first_p = 0;
4069 } 4076 }
4070 4077
4071 if (i == start_hpos || x != current_x) 4078 if (i == start_hpos || x != current_x)