diff options
Diffstat (limited to 'src/displayapp/LittleVgl.cpp')
-rw-r--r-- | src/displayapp/LittleVgl.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index e7b58c16..25f35917 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -16,14 +16,22 @@ static void disp_flush(lv_disp_drv_t* disp_drv, const lv_area_t* area, lv_color_ lvgl->FlushDisplay(area, color_p); } +static void rounder(lv_disp_drv_t* disp_drv, lv_area_t* area) { + auto* lvgl = static_cast<LittleVgl*>(disp_drv->user_data); + if (lvgl->GetFullRefresh()) { + area->x1 = 0; + area->x2 = LV_HOR_RES - 1; + area->y1 = 0; + area->y2 = LV_VER_RES - 1; + } +} + bool touchpad_read(lv_indev_drv_t* indev_drv, lv_indev_data_t* data) { auto* lvgl = static_cast<LittleVgl*>(indev_drv->user_data); return lvgl->GetTouchPadInfo(data); } -LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel) - : lcd {lcd}, touchPanel {touchPanel}, previousClick {0, 0} { - +LittleVgl::LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel) : lcd {lcd}, touchPanel {touchPanel} { } void LittleVgl::Init() { @@ -48,6 +56,7 @@ void LittleVgl::InitDisplay() { /*Set a display buffer*/ disp_drv.buffer = &disp_buf_2; disp_drv.user_data = this; + disp_drv.rounder_cb = rounder; /*Finally register the driver*/ lv_disp_drv_register(&disp_drv); @@ -78,6 +87,7 @@ void LittleVgl::SetFullRefresh(FullRefreshDirections direction) { lv_disp_set_direction(lv_disp_get_default(), 4); } } + fullRefresh = true; } void LittleVgl::FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { |