Slightly change centering. Appears to ride a tiny bit high because it leaves room for below-line characters, like gjpqy

This commit is contained in:
Reed Nightingale 2020-01-19 22:54:42 -08:00
parent 755b2214f9
commit 4aea1b7126
1 changed files with 1 additions and 1 deletions

View File

@ -238,7 +238,7 @@ void displayText(char *text, int x1, int y1, int w, int h, int color, int backgr
uint16_t height_out;
tft.getTextBounds(text,x1,y1,&x1_out,&y1_out,&width_out,&height_out,w);
x1 += (w - ( (int32_t)width_out + (x1_out-x1)))/2;
y1 += (ubitx_font->yAdvance + h - ( (int32_t)height_out + (y1_out-y1)))/2;
y1 += (ubitx_font->yAdvance + h - ( (int32_t)height_out))/2;
displayRawText(text,x1,y1,w,color,background);
}