From b93a40a54fd8a530cc31abf60b6f8696ba1d1fb5 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Tue, 23 Oct 2018 14:20:45 +0100 Subject: [PATCH] Correct datum marker for different screen sizes datum marker was not in correct position on screens that are not 320x240 pixels --- .../Smooth Fonts/Font_Demo_2/Font_Demo_2.ino | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Smooth Fonts/Font_Demo_2/Font_Demo_2.ino b/examples/Smooth Fonts/Font_Demo_2/Font_Demo_2.ino index a2ef436..6dbf769 100644 --- a/examples/Smooth Fonts/Font_Demo_2/Font_Demo_2.ino +++ b/examples/Smooth Fonts/Font_Demo_2/Font_Demo_2.ino @@ -148,73 +148,73 @@ void loop() { tft.loadFont(AA_FONT_SMALL); tft.setTextDatum(TL_DATUM); tft.drawString("[Top left]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(TC_DATUM); tft.drawString("[Top centre]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(TR_DATUM); tft.drawString("[Top right]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(ML_DATUM); tft.drawString("[Middle left]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(MC_DATUM); tft.drawString("[Middle centre]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(MR_DATUM); tft.drawString("[Middle right]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(BL_DATUM); tft.drawString("[Bottom left]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(BC_DATUM); tft.drawString("[Bottom centre]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(BR_DATUM); tft.drawString("[Bottom right]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(L_BASELINE); tft.drawString("[Left baseline]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(C_BASELINE); tft.drawString("[Centre baseline]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.fillScreen(TFT_BLACK); tft.setTextDatum(R_BASELINE); tft.drawString("[Right baseline]", xpos, ypos); - drawDatumMarker(160,120); + drawDatumMarker(xpos, ypos); delay(1000); tft.unloadFont(); // Remove the font to recover memory used