display: split DisplayBuffer and Display (#5001)

This commit is contained in:
Kamil Trzciński
2023-07-05 21:33:26 +02:00
committed by GitHub
parent 301a78f983
commit 677b2c6618
15 changed files with 960 additions and 902 deletions
@@ -7,6 +7,17 @@ namespace touchscreen {
static const char *const TAG = "touchscreen";
void Touchscreen::set_display(display::Display *display) {
this->display_ = display;
this->display_width_ = display->get_width();
this->display_height_ = display->get_height();
this->rotation_ = static_cast<TouchRotation>(display->get_rotation());
if (this->rotation_ == ROTATE_90_DEGREES || this->rotation_ == ROTATE_270_DEGREES) {
std::swap(this->display_width_, this->display_height_);
}
}
void Touchscreen::send_touch_(TouchPoint tp) {
ESP_LOGV(TAG, "Touch (x=%d, y=%d)", tp.x, tp.y);
this->touch_trigger_.trigger(tp);