[Top][All Lists]

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

Re: Cursor in non-selected windows is 1 pixel too small

From: Eli Zaretskii
Subject: Re: Cursor in non-selected windows is 1 pixel too small
Date: Sat, 11 Mar 2006 14:09:22 +0200

> Date: Sun, 05 Mar 2006 18:14:03 +0900
> From: YAMAMOTO Mitsuharu <address@hidden>
> Cc: Eli Zaretskii <address@hidden>,
>       Markus Gritsch <address@hidden>, address@hidden
> Also works for Mac, because some adjustment is made in the drawing
> routine mac_draw_rectangle (in macterm.c) so it simulates
> XDrawRectangle.
>   SetRect (&r, x, y, x + width + 1, y + height + 1);
>   FrameRect (&r);

Yes, and then all the callers of mac_draw_rectangle except
x_draw_hollow_cursor need to subtract 1 from width and height.  Funny.

I modified mac_draw_rectangle to not add 1 to these two dimensions,
and then removed the decrements from its callers.

> By the way, Quartz 2D (as opposed to QuickDraw above) needs another
> kind of adjustment to get the same result:
>   CGContextStrokeRect (context,
>                        CGRectMake (x + 0.5f, y + 0.5f, width, height));

I cannot find this code in Emacs.

> The W32 port seems to have an adjustment for the cursor width in
> get_phys_cursor_geometry:
>   wd = glyph->pixel_width - 1;
> #ifdef HAVE_NTGUI
>   wd++; /* Why? */
> #endif
> So, wherever we add adjustment, it should be done in a consistent way
> between width and height, I think.

I didn't do anything about this bit.

reply via email to

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