From 80e45d368e3fa89136e5ffb52244c67267b965f2 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Mon, 13 Jun 2022 17:58:01 +0200 Subject: [PATCH] Added isLandscape() --- src/tftinstance.cpp | 2 +- src/tftinstance.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tftinstance.cpp b/src/tftinstance.cpp index 4b6e7b4..9cb17f5 100644 --- a/src/tftinstance.cpp +++ b/src/tftinstance.cpp @@ -2,4 +2,4 @@ namespace espgui { TFT_eSPI tft; -} +} // namespace espgui diff --git a/src/tftinstance.h b/src/tftinstance.h index 87ec58b..07cc6a6 100644 --- a/src/tftinstance.h +++ b/src/tftinstance.h @@ -5,4 +5,8 @@ namespace espgui { extern TFT_eSPI tft; +inline bool isLandscape() +{ + return (tft.getRotation() == 1 || tft.getRotation() == 3); +} }