diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 8 |
1 files changed, 7 insertions, 1 deletions
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 @@ | |||
27 | * KIND, either express or implied. | 27 | * KIND, either express or implied. |
28 | * | 28 | * |
29 | ****************************************************************************/ | 29 | ****************************************************************************/ |
30 | #include "language.h" | ||
30 | 31 | ||
31 | #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ | 32 | #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ |
32 | #define LCDFN(fn) lcd_ ## fn | 33 | #define LCDFN(fn) lcd_ ## fn |
@@ -170,11 +171,16 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str, | |||
170 | int style, int offset) | 171 | int style, int offset) |
171 | { | 172 | { |
172 | int xpos, ypos, w, h; | 173 | int xpos, ypos, w, h; |
174 | unsigned long chars_in_str; | ||
173 | LCDFN(scroll_stop_line)(current_vp, y); | 175 | LCDFN(scroll_stop_line)(current_vp, y); |
174 | if(!str || !str[0]) | 176 | if(!str || !str[0]) |
175 | return; | 177 | return; |
178 | |||
179 | chars_in_str = utf8length((char *)str); | ||
176 | LCDFN(getstringsize)(str, &w, &h); | 180 | LCDFN(getstringsize)(str, &w, &h); |
177 | xpos = x * w / utf8length((char *)str); | 181 | xpos = x * w / chars_in_str; |
182 | if (lang_is_rtl()) | ||
183 | xpos = current_vp->width - w - xpos; | ||
178 | ypos = y * h; | 184 | ypos = y * h; |
179 | LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); | 185 | LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); |
180 | } | 186 | } |