From 3ac730fb2f5b7231e77d5d7c3822e7cc59fb4e59 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Tue, 22 Oct 2024 14:06:58 +1100 Subject: [PATCH] [lvgl] Fix rotation code for 90deg (Bugfix) (#7653) --- esphome/components/lvgl/lvgl_esphome.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/lvgl/lvgl_esphome.cpp b/esphome/components/lvgl/lvgl_esphome.cpp index c8f7848a4f..70cfb859de 100644 --- a/esphome/components/lvgl/lvgl_esphome.cpp +++ b/esphome/components/lvgl/lvgl_esphome.cpp @@ -146,7 +146,7 @@ void LvglComponent::draw_buffer_(const lv_area_t *area, lv_color_t *ptr) { lv_color_t *dst = this->rotate_buf_; switch (this->rotation) { case display::DISPLAY_ROTATION_90_DEGREES: - for (lv_coord_t x = height - 1; x-- != 0;) { + for (lv_coord_t x = height; x-- != 0;) { for (lv_coord_t y = 0; y != width; y++) { dst[y * height + x] = *ptr++; }