[Top][All Lists]

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

Re: Bidi reordering engine upgraded

From: Thien-Thi Nguyen
Subject: Re: Bidi reordering engine upgraded
Date: Thu, 16 Oct 2014 11:42:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

() Eli Zaretskii <address@hidden>
() Thu, 16 Oct 2014 10:21:52 +0300

   why we subtract 1 pixel from the cursor glyph's pixel_width

I see in XDrawRectangle(3):

 The XDrawRectangle and XDrawRectangles functions draw the
 outlines of the specified rectangle or rectangles as if a
 five-point PolyLine protocol request were specified for
 each rectangle:

   [x,y] [x+width,y] [x+width,y+height] [x,y+height] [x,y]

So if you use the glyph width directly, the resulting rectangle
drawn will invade the next character cell by one pixel.  E.g.:
Given a glyph width of ten, this is wrong:

 | 0         1         2
 | 012345678901234567890123456
 |           XXXXXXXXXXX
 |           X         X

but this is right:

 | 0         1         2
 | 012345678901234567890123456
 |           XXXXXXXXXX
 |           X        X

Probably (i don't have docs handy) the other toolkits'
rectangle-drawing primitives draw from X,Y to X+W-1,Y+H-1
(NB the -1) so there is no need to manully decrement for them.

Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: signature.asc
Description: PGP signature

reply via email to

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