]> git.eshelyaron.com Git - emacs.git/commitdiff
(mode_line_string, marginal_area_string): Fix
authorKim F. Storm <storm@cua.dk>
Mon, 17 Jan 2005 08:28:28 +0000 (08:28 +0000)
committerKim F. Storm <storm@cua.dk>
Mon, 17 Jan 2005 08:28:28 +0000 (08:28 +0000)
off-by-one error in search for glyph.

src/dispnew.c

index ff26a4dc66c60222dd6867f70d3a810cedb235dc..1c3c56de80b7e10b83ee7c1e20a6ed73bb12b6c5 100644 (file)
@@ -5842,7 +5842,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height)
          it's the one we were looking for.  */
       glyph = row->glyphs[TEXT_AREA];
       end = glyph + row->used[TEXT_AREA];
-      for (x0 = *x; glyph < end && x0 > glyph->pixel_width; ++glyph)
+      for (x0 = *x; glyph < end && x0 >= glyph->pixel_width; ++glyph)
        x0 -= glyph->pixel_width;
       *x = glyph - row->glyphs[TEXT_AREA];
       if (glyph < end)
@@ -5934,7 +5934,7 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
 
       glyph = row->glyphs[area];
       end = glyph + row->used[area];
-      for (x0 = *x - x0; glyph < end && x0 > glyph->pixel_width; ++glyph)
+      for (x0 = *x - x0; glyph < end && x0 >= glyph->pixel_width; ++glyph)
        x0 -= glyph->pixel_width;
       *x = glyph - row->glyphs[area];
       if (glyph < end)