From 6d80565b1b5277820593de80bf036304be93c8ef Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Mon, 5 Oct 2009 11:43:38 +0000 Subject: RTL support in menus git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22945 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-bitmap-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'firmware/drivers/lcd-bitmap-common.c') diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index c1efd9097e..8d3b88f8e1 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -27,6 +27,7 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "language.h" #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ #define LCDFN(fn) lcd_ ## fn @@ -170,11 +171,16 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str, int style, int offset) { int xpos, ypos, w, h; + unsigned long chars_in_str; LCDFN(scroll_stop_line)(current_vp, y); if(!str || !str[0]) return; + + chars_in_str = utf8length((char *)str); LCDFN(getstringsize)(str, &w, &h); - xpos = x * w / utf8length((char *)str); + xpos = x * w / chars_in_str; + if (lang_is_rtl()) + xpos = current_vp->width - w - xpos; ypos = y * h; LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); } -- cgit v1.2.3