On Thursday, August 10, 2017 at 10:42:58 AM UTC-5, Edward K. Ream wrote:
>
> This affects only the line_numbering.py plugin.  The code in question is 
> in Leo's core: NumberBar.paintBlock.
>
> Something strange is happening.  My traces show the expected width values 
> (I think), but the enabled x value causes shorter line numbers to be 
> centered in the field, instead of right justified.  Maybe there a simple 
> explanation, but I haven't found it.
>

Oh joy.  Rev .bec9562 works using a different approach.

Rather than trying to adjust the x offset using font data, the code adds 
padding blank characters to the number.  Like this:

    s = str(n)
    pad = len(str(self.highest_line)) - len(s)
    s = ' '*pad + s
    x = 0

Setting x = 0 left justifies everything as far as the painter is concerned, 
but the added pad characters actually right justify the text.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to