|
@@ -54,7 +54,7 @@ static void pixel_callback(int16_t x, int16_t y, uint8_t count, uint8_t alpha,
|
54
|
54
|
if (x < 0 || x + count >= s->options->width) return;
|
55
|
55
|
|
56
|
56
|
while (count--) {
|
57
|
|
- lcd_write_point(240 - y - 1, x,
|
|
57
|
+ lcd_write_point(x, y,
|
58
|
58
|
blend(s->options->fg, s->options->bg, alpha));
|
59
|
59
|
x++;
|
60
|
60
|
}
|
|
@@ -75,22 +75,22 @@ static bool line_callback(const char *line, uint16_t count, void *state) {
|
75
|
75
|
int16_t line_height = s->options->font->font->line_height;
|
76
|
76
|
|
77
|
77
|
if (s->options->alignment == MF_ALIGN_LEFT) {
|
78
|
|
- lcd_write_rect(240 - s->options->y - 1 - line_height,
|
79
|
|
- s->options->x,
|
80
|
|
- 240 - s->options->y - 1,
|
|
78
|
+ lcd_write_rect(s->options->x,
|
|
79
|
+ s->options->y,
|
81
|
80
|
s->options->x + width,
|
|
81
|
+ s->options->y + line_height,
|
82
|
82
|
s->options->bg);
|
83
|
83
|
} else if (s->options->alignment == MF_ALIGN_CENTER) {
|
84
|
|
- lcd_write_rect(240 - s->options->y - 1 - line_height,
|
85
|
|
- s->options->x + s->options->width / 2 - width / 2,
|
86
|
|
- 240 - s->options->y - 1,
|
|
84
|
+ lcd_write_rect(s->options->x + s->options->width / 2 - width / 2,
|
|
85
|
+ s->options->y,
|
87
|
86
|
s->options->x + s->options->width / 2 + width / 2,
|
|
87
|
+ s->options->y + line_height,
|
88
|
88
|
s->options->bg);
|
89
|
89
|
} else if (s->options->alignment == MF_ALIGN_RIGHT) {
|
90
|
|
- lcd_write_rect(240 - s->options->y - 1 - line_height,
|
91
|
|
- s->options->x + s->options->width - width,
|
92
|
|
- 240 - s->options->y - 1,
|
|
90
|
+ lcd_write_rect(s->options->x + s->options->width - width,
|
|
91
|
+ s->options->y,
|
93
|
92
|
s->options->x + s->options->width,
|
|
93
|
+ s->options->y + line_height,
|
94
|
94
|
s->options->bg);
|
95
|
95
|
}
|
96
|
96
|
}
|
|
@@ -181,10 +181,10 @@ void text_box(const char *s) {
|
181
|
181
|
.font = &font,
|
182
|
182
|
};
|
183
|
183
|
|
184
|
|
- lcd_write_rect(240 - y - 1 - height,
|
185
|
|
- x,
|
186
|
|
- 240 - y - 1,
|
|
184
|
+ lcd_write_rect(x,
|
|
185
|
+ y,
|
187
|
186
|
x + width - 1,
|
|
187
|
+ y + height - 1,
|
188
|
188
|
text.bg);
|
189
|
189
|
|
190
|
190
|
text.text = s;
|