older version for rasplex, hope it works.

This commit is contained in:
2016-11-04 17:32:54 +01:00
parent c2f24e5ef6
commit 6b609a3c9d
40 changed files with 196 additions and 6764 deletions
+7 -1
View File
@@ -310,6 +310,9 @@ render_string(Widget *w, int left, int top, int right, int bottom, int fy)
if ((w != NULL) && (w->text != NULL) &&
(w->x > 0) && (w->y > 0) && (w->y > fy) && (w->y <= bottom - top)) {
int length;
char str[BUFSIZE];
/*
* FIXME: Could be a bug here? w->x is recalculated (On first
* call only? Is it preserved between calls?) and first
@@ -317,7 +320,10 @@ render_string(Widget *w, int left, int top, int right, int bottom, int fy)
* strings totally off-screen. Is this on purpose? (M. Dolze)
*/
w->x = min(w->x, right - left);
drivers_string(w->x + left, w->y + top, w->text);
length = min(right - left - w->x + 1, sizeof(str)-1);
strncpy(str, w->text, length);
str[length] = '\0';
drivers_string(w->x + left, w->y + top, str);
}
return 0;
}