diff options
| author | Eli Zaretskii | 2010-08-21 12:35:31 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-08-21 12:35:31 +0300 |
| commit | 40629f171babe6087c32d3211beeb23b136155bd (patch) | |
| tree | d6b14ab13caed5c4059c021753b628451a5f4f35 | |
| parent | d2625c3ded73eb75c43a8c0a7f20d624e85628a1 (diff) | |
| download | emacs-40629f171babe6087c32d3211beeb23b136155bd.tar.gz emacs-40629f171babe6087c32d3211beeb23b136155bd.zip | |
Fix mirroring pixel positions on GUI terminals.
dispnew.c (buffer_posn_from_coords): Fix off-by-one error in
mirroring pixel positions.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 21 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9b9e43864ab..403a588df4c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-08-21 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in | ||
| 4 | mirroring pixel positions. | ||
| 5 | |||
| 1 | 2010-08-20 Dan Nicolaescu <dann@ics.uci.edu> | 6 | 2010-08-20 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 7 | ||
| 3 | * alloc.c (malloc_sbrk_used, malloc_sbrk_unused): Remove, | 8 | * alloc.c (malloc_sbrk_used, malloc_sbrk_unused): Remove, |
diff --git a/src/dispnew.c b/src/dispnew.c index 547ab2a4187..9344d792f3d 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5386,12 +5386,12 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5386 | 5386 | ||
| 5387 | /* First, move to the beginning of the row corresponding to *Y. We | 5387 | /* First, move to the beginning of the row corresponding to *Y. We |
| 5388 | need to be in that row to get the correct value of base paragraph | 5388 | need to be in that row to get the correct value of base paragraph |
| 5389 | direction for the paragraph at *X. */ | 5389 | direction for the text at (*X, *Y). */ |
| 5390 | move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); | 5390 | move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); |
| 5391 | 5391 | ||
| 5392 | /* TO_X is the pixel position that the iterator will compute for the | 5392 | /* TO_X is the pixel position that the iterator will compute for the |
| 5393 | glyph at *X. This is because iterator positions are not offset | 5393 | glyph at *X. We add it.first_visible_x because iterator |
| 5394 | due to hscroll. */ | 5394 | positions include the hscroll. */ |
| 5395 | to_x = x0 + it.first_visible_x; | 5395 | to_x = x0 + it.first_visible_x; |
| 5396 | if (it.bidi_it.paragraph_dir == R2L) | 5396 | if (it.bidi_it.paragraph_dir == R2L) |
| 5397 | /* For lines in an R2L paragraph, we need to mirror TO_X wrt the | 5397 | /* For lines in an R2L paragraph, we need to mirror TO_X wrt the |
| @@ -5401,13 +5401,14 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5401 | display, we reverse their order in PRODUCE_GLYPHS, but the | 5401 | display, we reverse their order in PRODUCE_GLYPHS, but the |
| 5402 | iterator doesn't know about that.) The following line adjusts | 5402 | iterator doesn't know about that.) The following line adjusts |
| 5403 | the pixel position to the iterator geometry, which is what | 5403 | the pixel position to the iterator geometry, which is what |
| 5404 | move_it_* routines use. */ | 5404 | move_it_* routines use. (The -1 is because in a window whose |
| 5405 | to_x = window_box_width (w, TEXT_AREA) - to_x | 5405 | text-area width is W, the rightmost pixel position is W-1, and |
| 5406 | /* Text terminals need a one-character offset to get it right. */ | 5406 | it should be mirrored into zero pixel position.) */ |
| 5407 | - (FRAME_MSDOS_P (WINDOW_XFRAME (w)) | 5407 | to_x = window_box_width (w, TEXT_AREA) - to_x - 1; |
| 5408 | || FRAME_TERMCAP_P (WINDOW_XFRAME (w))); | 5408 | |
| 5409 | 5409 | /* Now move horizontally in the row to the glyph under *X. Second | |
| 5410 | /* Now move horizontally in the row to the glyph under *X. */ | 5410 | argument is ZV to prevent move_it_in_display_line from matching |
| 5411 | based on buffer positions. */ | ||
| 5411 | move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X); | 5412 | move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X); |
| 5412 | 5413 | ||
| 5413 | Fset_buffer (old_current_buffer); | 5414 | Fset_buffer (old_current_buffer); |