Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: lcd_puts_scroll -- why are X and Y so odd?

lcd_puts_scroll -- why are X and Y so odd?

From: Bill Janssen <janssen_at_parc.com>
Date: 2006-07-12

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
source code.

Can anyone explain why things work this way?

Bill
Received on Wed Jul 12 04:47:37 2006


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa