Fixed simu inverted display
This commit is contained in:
committed by
Raphael Coeffic
parent
ee0c37157d
commit
7702ee7bba
@@ -40,16 +40,6 @@ static void flushLcd(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_
|
||||
lv_area_t refr_area;
|
||||
lv_area_copy(&refr_area, area);
|
||||
|
||||
#if defined(LCD_VERTICAL_INVERT)
|
||||
lv_coord_t tmp_coord;
|
||||
tmp_coord = refr_area.y2;
|
||||
refr_area.y2 = LCD_H - refr_area.y1 - 1;
|
||||
refr_area.y1 = LCD_H - tmp_coord - 1;
|
||||
tmp_coord = refr_area.x2;
|
||||
refr_area.x2 = LCD_W - refr_area.x1 - 1;
|
||||
refr_area.x1 = LCD_W - tmp_coord - 1;
|
||||
#endif
|
||||
|
||||
if (refr_area.x1 != 0 || refr_area.x2 != LCD_W-1 || refr_area.y1 != 0 ||
|
||||
refr_area.y2 != LCD_H-1) {
|
||||
TRACE("partial refresh @ 0x%p {%d,%d,%d,%d}", color_p, refr_area.x1,
|
||||
|
||||
@@ -68,17 +68,21 @@ BitmapBuffer * lcdFront = &_lcd2;
|
||||
|
||||
void newLcdRefresh(uint16_t *buffer, const rect_t& copy_area)
|
||||
{
|
||||
|
||||
#if defined(LCD_VERTICAL_INVERT)
|
||||
coord_t x1 = LCD_W - copy_area.w - copy_area.x;
|
||||
coord_t y1 = LCD_H - copy_area.h - copy_area.y;
|
||||
|
||||
auto total = copy_area.w * copy_area.h;
|
||||
auto src = buffer + total - 1;
|
||||
#else
|
||||
coord_t x1 = copy_area.x;
|
||||
coord_t y1 = copy_area.y;
|
||||
|
||||
auto src = buffer;
|
||||
#endif
|
||||
auto dst = simuLcdBuf + copy_area.y * LCD_W + copy_area.x;
|
||||
|
||||
auto y2 = copy_area.y + copy_area.h;
|
||||
for (auto line = copy_area.y; line < y2; line++) {
|
||||
auto dst = simuLcdBuf + y1 * LCD_W + x1;
|
||||
for (auto line = 0; line < copy_area.h; line++) {
|
||||
|
||||
auto line_end = dst + copy_area.w;
|
||||
while (dst != line_end) {
|
||||
|
||||
Reference in New Issue
Block a user