emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101157: Fix mirroring pixel position


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101157: Fix mirroring pixel positions on GUI terminals.
Date: Sat, 21 Aug 2010 12:35:31 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101157
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2010-08-21 12:35:31 +0300
message:
  Fix mirroring pixel positions on GUI terminals.
  
   dispnew.c (buffer_posn_from_coords): Fix off-by-one error in
   mirroring pixel positions.
modified:
  src/ChangeLog
  src/dispnew.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-08-21 02:21:51 +0000
+++ b/src/ChangeLog     2010-08-21 09:35:31 +0000
@@ -1,3 +1,8 @@
+2010-08-21  Eli Zaretskii  <address@hidden>
+
+       * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in
+       mirroring pixel positions.
+
 2010-08-20  Dan Nicolaescu  <address@hidden>
 
        * alloc.c (malloc_sbrk_used, malloc_sbrk_unused): Remove,

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2010-08-20 20:55:09 +0000
+++ b/src/dispnew.c     2010-08-21 09:35:31 +0000
@@ -5386,12 +5386,12 @@
 
   /* First, move to the beginning of the row corresponding to *Y.  We
      need to be in that row to get the correct value of base paragraph
-     direction for the paragraph at *X.  */
+     direction for the text at (*X, *Y).  */
   move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y);
 
   /* TO_X is the pixel position that the iterator will compute for the
-     glyph at *X.  This is because iterator positions are not offset
-     due to hscroll.  */
+     glyph at *X.  We add it.first_visible_x because iterator
+     positions include the hscroll.  */
   to_x = x0 + it.first_visible_x;
   if (it.bidi_it.paragraph_dir == R2L)
     /* For lines in an R2L paragraph, we need to mirror TO_X wrt the
@@ -5401,13 +5401,14 @@
        display, we reverse their order in PRODUCE_GLYPHS, but the
        iterator doesn't know about that.)  The following line adjusts
        the pixel position to the iterator geometry, which is what
-       move_it_* routines use.  */
-    to_x = window_box_width (w, TEXT_AREA) - to_x
-          /* Text terminals need a one-character offset to get it right.  */
-          - (FRAME_MSDOS_P (WINDOW_XFRAME (w))
-             || FRAME_TERMCAP_P (WINDOW_XFRAME (w)));
+       move_it_* routines use.  (The -1 is because in a window whose
+       text-area width is W, the rightmost pixel position is W-1, and
+       it should be mirrored into zero pixel position.)  */
+    to_x = window_box_width (w, TEXT_AREA) - to_x - 1;
 
-  /* Now move horizontally in the row to the glyph under *X. */
+  /* Now move horizontally in the row to the glyph under *X.  Second
+     argument is ZV to prevent move_it_in_display_line from matching
+     based on buffer positions.  */
   move_it_in_display_line (&it, ZV, to_x, MOVE_TO_X);
 
   Fset_buffer (old_current_buffer);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]