emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Re: mode-line redisplay bug]


From: Jan D.
Subject: Re: address@hidden: Re: mode-line redisplay bug]
Date: Sun, 9 Oct 2005 08:11:51 +0200


      /* Arrange for the division in FRAME_PIXEL_X_TO_COL etc. to
     round down even for negative values.  */
      if (gx < 0)
    gx -= width - 1;
      if (gy < 0)
    gy -= height - 1;

      gx = (gx + width - 1) / width * width;
      gy = (gy + height - 1) / height * height;

      last_mouse_glyph.width  = width;
      last_mouse_glyph.height = height;
      last_mouse_glyph.x = gx;
      last_mouse_glyph.y = gy;

gx and gy are initially the position of the mouse. We are trying to
find the rectangle around the glyph under the mouse here.

On Windows, I found that this code returns the rectangle of a glyph
diagonally adjacent to the glyph we want. I am not sure if I am
missing something about the way X co-ordinates work, but I think the
two lines that round gx and gy should be simply:

      gx = gx / width * width;
      gy = gy / height * height;


AFAIK co-ordinates on W32 behave the same as on X, so your patch should be OK. It is easy to confirm anyway.

    Jan D.





reply via email to

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