Rockbox mail archive
Subject: lcd_puts_scroll -- why are X and Y so odd?
lcd_puts_scroll -- why are X and Y so odd?
I've been looking at the implementation of lcd_puts_scroll() and
related functions on the lcd-16bit code. It's really odd. There's
really no good way to specify an X value other than 0.
The formula for vertical position of the line is just the (Y * font
height) + YMARGIN, so you can think of it as just the line number, but
the formula for the horizontal position of the beginning of the
scrolling line is XMARGIN + (X *
width-of-the-string-in-rendered-pixels) / UTF8LENGTH(string). This
means that it depends on the font, the string, and length of the
string. It's impossible to make two (different) scrolling strings
line up on different lines because of this nutty formula.
Because of this, no one ever uses a value other than 0 in all of the
Can anyone explain why things work this way?
Received on Wed Jul 12 04:47:37 2006
Page was last modified "Jan 10 2012" The Rockbox Crew