Просмотр исходного кода

fix: 漏了几个接口没加偏移参数

chenxuuu 4 лет назад
Родитель
Сommit
1091b2d1cd
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      components/lcd/luat_lcd.c

+ 3 - 3
components/lcd/luat_lcd.c

@@ -192,7 +192,7 @@ int luat_lcd_clear(luat_lcd_conf_t* conf,uint32_t color){
     uint8_t *buf = NULL;
     data[0] = color >> 8;
     data[1] = color;
-    luat_lcd_set_address(conf,0, 0, conf->w - 1, conf->h - 1);
+    luat_lcd_set_address(conf,conf->xoffset, conf->yoffset, conf->w + conf->xoffset - 1, conf->h + conf->yoffset - 1);
     buf = luat_heap_malloc(conf->w*conf->h/10);
     if (buf)
     {
@@ -223,7 +223,7 @@ int luat_lcd_clear(luat_lcd_conf_t* conf,uint32_t color){
 }
 
 int luat_lcd_draw_point(luat_lcd_conf_t* conf, uint16_t x, uint16_t y, uint32_t color) {
-    luat_lcd_set_address(conf,x, y, x, y);
+    luat_lcd_set_address(conf,x+conf->xoffset, y+conf->yoffset, x+conf->xoffset, y+conf->yoffset);
     lcd_write_half_word(conf,color);
     return 0;
 }
@@ -236,7 +236,7 @@ int luat_lcd_draw_line(luat_lcd_conf_t* conf,uint16_t x1, uint16_t y1, uint16_t
     if (y1 == y2)
     {
         /* fast draw transverse line */
-        luat_lcd_set_address(conf,x1, y1, x2, y2);
+        luat_lcd_set_address(conf,x1+conf->xoffset, y1+conf->yoffset, x2+conf->xoffset, y2+conf->yoffset);
         uint8_t line_buf[480] = {0};
         for (i = 0; i < x2 - x1; i++)
         {