summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-bitmap-common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 26491e78e8..70ae00ba84 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -194,14 +194,12 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
194 int style, int offset) 194 int style, int offset)
195{ 195{
196 int xpos, ypos, w, h; 196 int xpos, ypos, w, h;
197 unsigned long chars_in_str;
198 LCDFN(scroll_stop_line)(current_vp, y); 197 LCDFN(scroll_stop_line)(current_vp, y);
199 if(!str || !str[0]) 198 if(!str || !str[0])
200 return; 199 return;
201 200
202 chars_in_str = utf8length((char *)str);
203 LCDFN(getstringsize)(str, &w, &h); 201 LCDFN(getstringsize)(str, &w, &h);
204 xpos = x * w / chars_in_str; 202 xpos = x * LCDFN(getstringsize)(" ", NULL, NULL);
205 ypos = y * h; 203 ypos = y * h;
206 LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset); 204 LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, offset);
207} 205}
@@ -289,7 +287,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
289 s->y = y; 287 s->y = y;
290 s->len = utf8length(string); 288 s->len = utf8length(string);
291 s->offset = offset; 289 s->offset = offset;
292 s->startx = x * s->width / s->len; 290 s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL);
293 s->backward = false; 291 s->backward = false;
294 292
295 LCDFN(scroll_info).lines++; 293 LCDFN(scroll_info).lines++;