|
Rockbox mail archiveSubject: 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: Tue, 11 Jul 2006 19:45:08 PDT 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 2006-07-12 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |