diff options
| author | Kim F. Storm | 2005-03-10 14:55:22 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-03-10 14:55:22 +0000 |
| commit | 8964fd83cd1a923a3c3890005d1c4def52d4730e (patch) | |
| tree | b1c4eeac5fe2d9428aebffe0b6590dad124d71f4 /src | |
| parent | b0a6f45ce459d55aaa7fdb73735aba8b4bfdbc93 (diff) | |
| download | emacs-8964fd83cd1a923a3c3890005d1c4def52d4730e.tar.gz emacs-8964fd83cd1a923a3c3890005d1c4def52d4730e.zip | |
(pos_visible_p): Fix X value in last line of buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 9c2d3c2554d..42f0097a7cb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1298,6 +1298,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1298 | /* Note that we may overshoot because of invisible text. */ | 1298 | /* Note that we may overshoot because of invisible text. */ |
| 1299 | if (IT_CHARPOS (it) >= charpos) | 1299 | if (IT_CHARPOS (it) >= charpos) |
| 1300 | { | 1300 | { |
| 1301 | int top_x = it.current_x; | ||
| 1301 | int top_y = it.current_y; | 1302 | int top_y = it.current_y; |
| 1302 | int bottom_y = (last_height = 0, line_bottom_y (&it)); | 1303 | int bottom_y = (last_height = 0, line_bottom_y (&it)); |
| 1303 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); | 1304 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); |
| @@ -1306,15 +1307,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1306 | visible_p = bottom_y > window_top_y; | 1307 | visible_p = bottom_y > window_top_y; |
| 1307 | else if (top_y < it.last_visible_y) | 1308 | else if (top_y < it.last_visible_y) |
| 1308 | visible_p = 1; | 1309 | visible_p = 1; |
| 1309 | if (visible_p && x) | 1310 | if (visible_p) |
| 1310 | { | 1311 | { |
| 1311 | *x = it.current_x; | 1312 | *x = top_x; |
| 1312 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); | 1313 | *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); |
| 1313 | if (rtop) | 1314 | *rtop = max (0, window_top_y - top_y); |
| 1314 | { | 1315 | *rbot = max (0, bottom_y - it.last_visible_y); |
| 1315 | *rtop = max (0, window_top_y - top_y); | ||
| 1316 | *rbot = max (0, bottom_y - it.last_visible_y); | ||
| 1317 | } | ||
| 1318 | } | 1316 | } |
| 1319 | } | 1317 | } |
| 1320 | else | 1318 | else |
| @@ -1327,18 +1325,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) | |||
| 1327 | if (charpos < IT_CHARPOS (it)) | 1325 | if (charpos < IT_CHARPOS (it)) |
| 1328 | { | 1326 | { |
| 1329 | visible_p = 1; | 1327 | visible_p = 1; |
| 1330 | if (x) | 1328 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); |
| 1331 | { | 1329 | *x = it2.current_x; |
| 1332 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); | 1330 | *y = it2.current_y + it2.max_ascent - it2.ascent; |
| 1333 | *x = it2.current_x; | 1331 | *rtop = max (0, -it2.current_y); |
| 1334 | *y = it2.current_y + it2.max_ascent - it2.ascent; | 1332 | *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent) |
| 1335 | if (rtop) | 1333 | - it.last_visible_y)); |
| 1336 | { | ||
| 1337 | *rtop = max (0, -it2.current_y); | ||
| 1338 | *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent) | ||
| 1339 | - it.last_visible_y)); | ||
| 1340 | } | ||
| 1341 | } | ||
| 1342 | } | 1334 | } |
| 1343 | } | 1335 | } |
| 1344 | 1336 | ||