mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-09-10 16:14:18 -04:00
Fix text alignment
This commit is contained in:
parent
e0a963f9ed
commit
6eed9a40c1
@ -210,9 +210,9 @@ void displayText(char *text, int x1, int y1, int w, int h, int color, int backgr
|
|||||||
uint16_t width_out;
|
uint16_t width_out;
|
||||||
uint16_t height_out;
|
uint16_t height_out;
|
||||||
tft.getTextBounds(text,x1,y1,&x1_out,&y1_out,&width_out,&height_out);
|
tft.getTextBounds(text,x1,y1,&x1_out,&y1_out,&width_out,&height_out);
|
||||||
x1_out += (w - width_out)/2;
|
x1 += (w - ( width_out + (x1_out-x1)))/2;
|
||||||
y1_out += 2*height_out + (h - height_out)/2;
|
y1 += h - (h - height_out)/2;
|
||||||
displayRawText(text,x1_out,y1_out,color,background);
|
displayRawText(text,x1,y1,color,background);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupTouch(){
|
void setupTouch(){
|
||||||
|
Loading…
Reference in New Issue
Block a user