[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bidi reordering engine upgraded
From: |
Eli Zaretskii |
Subject: |
Re: Bidi reordering engine upgraded |
Date: |
Fri, 17 Oct 2014 21:45:47 +0300 |
> From: Jan Djärv <address@hidden>
> Date: Fri, 17 Oct 2014 19:45:34 +0200
> Cc: Dmitry Antipov <address@hidden>,
> address@hidden
>
> > === modified file 'src/xdisp.c'
> > --- src/xdisp.c 2014-10-14 18:10:37 +0000
> > +++ src/xdisp.c 2014-10-16 07:16:49 +0000
> > @@ -2303,9 +2303,6 @@ get_phys_cursor_geometry (struct window
> > rectangle as wide as the glyph, but use a canonical character
> > width instead. */
> > wd = glyph->pixel_width - 1;
> > -#if defined (HAVE_NTGUI) || defined (HAVE_NS)
> > - wd++; /* Why? */
> > -#endif
> >
> > x = w->phys_cursor.x;
> > if (x < 0)
> >
> >
> > I never understood why we subtract 1 pixel from the cursor glyph's
> > pixel_width, anyway, and w32 and ns countermanded that, as you see.
> > Maybe we should also limit 'wd' from below, so it is at least 1.
> >
> > Jan, can you comment on these issues and on the proposed patch,
> > please?
>
> As you figured out, XDrawRectangle with width 0 and non-zero height draws a
> 1-pixel width line.
Thanks. Since this appears to be specific to X, I propose the
change below for the trunk. Does it look reasonable?
The only other question is whether we want the hollow cursor on X to
disappear when the underlying glyph is displayed as a thin space of 1
pixel. It doesn't disappear on w32 (and possibly also on NS, although
I cannot test that). Opinions, anyone?
=== modified file 'src/xdisp.c'
--- src/xdisp.c 2014-10-14 18:10:37 +0000
+++ src/xdisp.c 2014-10-17 18:39:20 +0000
@@ -2302,10 +2302,7 @@ get_phys_cursor_geometry (struct window
glyph, and `x-stretch-block-cursor' is nil, don't draw a
rectangle as wide as the glyph, but use a canonical character
width instead. */
- wd = glyph->pixel_width - 1;
-#if defined (HAVE_NTGUI) || defined (HAVE_NS)
- wd++; /* Why? */
-#endif
+ wd = glyph->pixel_width;
x = w->phys_cursor.x;
if (x < 0)
=== modified file 'src/xterm.c'
--- src/xterm.c 2014-10-17 16:14:37 +0000
+++ src/xterm.c 2014-10-17 18:42:08 +0000
@@ -7965,7 +7965,7 @@ x_draw_hollow_cursor (struct window *w,
/* Compute frame-relative coordinates for phys cursor. */
get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h);
- wd = w->phys_cursor_width;
+ wd = w->phys_cursor_width - 1;
/* The foreground of cursor_gc is typically the same as the normal
background color, which can cause the cursor box to be invisible. */
@@ -7981,9 +7981,9 @@ x_draw_hollow_cursor (struct window *w,
glyph, unless the cursor box is as wide as the glyph or wider
(the latter happens when x-stretch-cursor is non-nil). */
if ((cursor_glyph->resolved_level & 1) != 0
- && cursor_glyph->pixel_width > w->phys_cursor_width)
+ && cursor_glyph->pixel_width > wd)
{
- x += cursor_glyph->pixel_width - w->phys_cursor_width;
+ x += cursor_glyph->pixel_width - wd;
if (wd > 0)
wd -= 1;
}
@@ -8086,12 +8086,12 @@ x_draw_bar_cursor (struct window *w, str
&dummy_y, &dummy_h);
if ((cursor_glyph->resolved_level & 1) != 0
- && cursor_glyph->pixel_width > w->phys_cursor_width)
- x += cursor_glyph->pixel_width - w->phys_cursor_width;
+ && cursor_glyph->pixel_width > w->phys_cursor_width - 1)
+ x += cursor_glyph->pixel_width - w->phys_cursor_width - 1;
XFillRectangle (dpy, window, gc, x,
WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
row->height - width),
- w->phys_cursor_width, width);
+ w->phys_cursor_width - 1, width);
}
XSetClipMask (dpy, gc, None);
- Re: Bidi reordering engine upgraded, (continued)
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/17
- Re: Bidi reordering engine upgraded, Thien-Thi Nguyen, 2014/10/17
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/17
- Re: Bidi reordering engine upgraded, Thien-Thi Nguyen, 2014/10/17
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/17
- Re: Bidi reordering engine upgraded, Dmitry Antipov, 2014/10/16
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/16
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/16
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/17
- Re: Bidi reordering engine upgraded, Jan Djärv, 2014/10/17
- Re: Bidi reordering engine upgraded,
Eli Zaretskii <=
- Re: Bidi reordering engine upgraded, Stefan Monnier, 2014/10/17
- Re: Bidi reordering engine upgraded, Jan Djärv, 2014/10/18
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/18
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/18
- Re: Bidi reordering engine upgraded, Jan Djärv, 2014/10/19
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/19
- Re: Bidi reordering engine upgraded, Jan Djärv, 2014/10/19
- Re: Bidi reordering engine upgraded, Eli Zaretskii, 2014/10/19
Re: Bidi reordering engine upgraded, grischka, 2014/10/17