emacs-devel
[Top][All Lists]
Advanced

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

Re: Calculating screen relative X when horizontal scrolling.


From: Eli Zaretskii
Subject: Re: Calculating screen relative X when horizontal scrolling.
Date: Sat, 20 Oct 2018 10:13:26 +0300

> Date:  Fri, 19 Oct 2018 12:58:56 -0700
> From:  Keith David Bershatsky <address@hidden>
> Cc:  address@hidden
> 
> For reference point of this particular analysis:
> 
> it->lnum_pixel_width == 44

Are your problems limited to the situation where line numbers are
displayed?

> To help me see what is happening, I put in a few new entries just above 
> 'glyph->charpos = ' in all six (6) locations within xdisp.c and assigned a 
> new "gizmo" (for lack of knowing the proper name) like this 'glyph->x = 
> it->current_x;' with the appropriate corresponding entry for glyph->x in 
> dispextern.h.  In the custom dump glyph row (discussed above), I can see that 
> glyph->x for the first 'の' character is actually 143, not 99.

Since 143 = 99 + 44, and first_visible_x for scroll-left of 9 is 99 in
your case, I think everything is OK.  You just need to account for
lnum_pixel_width, which is 44 in this case.

When you change scroll-left to 10, a wide character such as 'の' will
not move off the display if line numbers are displayed, because we
don't know how to draw partial characters in that mode.  This might be
considered a bug in the current display code.  But I don't think this
should affect your code.



reply via email to

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