From 7eddcc15ff1df7c3290ca646dda76836b0746ac8 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 12 Nov 2018 22:18:44 +0000 Subject: [PATCH] _cx hack --- tftdisplay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tftdisplay.cpp b/tftdisplay.cpp index 01cbb80..3676cf4 100644 --- a/tftdisplay.cpp +++ b/tftdisplay.cpp @@ -42,6 +42,7 @@ void TFTDisplay::begin(unsigned bg, unsigned fg, orientation_t orient) { _dx = espi.width(); _dy = espi.height(); _cy = espi.fontHeight(); + _cx = 6; // FIXME #endif setColor(fg); @@ -86,6 +87,9 @@ void TFTDisplay::drawString(const char *s, unsigned x, unsigned y) { #if defined(USE_UTFT) utft.print(s, x, y); #elif defined(USE_ESPI) + espi.setTextDatum(TL_DATUM); + unsigned w = espi.textWidth(s); + espi.fillRect(x, y, w, _cy, _bg); espi.drawString(s, x, y); #endif }