Description
When displaying some objects with LVGL, LVGL display only a part of the objects. For example, if i draw a rectangle on the screen, LVGL will display only a part of this rectangle.
If I want to display all this rectangle, I have to display the rectangle twice times.
What MCU/Processor/Board and compiler are you using?
NRF52840
What do you experience?
I was working with the version 7.3.0 and there were no problems. Then I update my version of LVGL, and the problem I mentionned appear.
To understand the origin of this bug, I search the last commit where the code was working for me.
This commit is : 71e5618380fecc259bb96d214014768ebbbd895a. (old version)
From the commit : d0cc9283e760a7d7db35ba792009749adf762486 the bug appear (new version). So I checked the modification bewteen the 2 commits.
I saw you changed the method lv_obj_invalide_area() bewteen the 2 commits. I put here the 2 code versions old one and new one (I remove what is useless in my explanation).
The new version code :
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
{
bool visible = lv_obj_area_is_visible(obj, &area_tmp);
if(visible) _lv_inv_area(lv_obj_get_disp(obj), &area_tmp);
}
bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
{
if(lv_obj_get_hidden(obj)) return false;
/*Invalidate the object only if it belongs to the curent or previous'*/
if(toto)
{
//do some stuff and return false if needed
}
return true;
}
The old version code :
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
{ /*Invalidate the object only if it belongs to the curent or previous'*/
if(toto)
{
//do some stuff and return false if needed
if(is_common) _lv_inv_area(disp, &area_trunc);
}
}
So basically the 2 code version do the same stuff, but there is one difference. If we look at the moment were LVGL invalidate an area :
- In the old version : Inside the conditional block
- In the new version : Outside the conditional block
This mean that in the new version, you will invalidate the area if toto = false
, but in the old version, you will not invalidate the area if toto = false
.
I try to change the new code version as follow :
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
{ /*Invalidate the object only if it belongs to the curent or previous'*/
if(toto)
{
//do some stuff and return false if needed
return true;
}
return false;
}
This is working great for me and that match exactly the old LVGL version behavior.
I don’t know if there is a purpose between this 2 different behavior, but this difference cause a bug on my software.
What do you expect?
I except that this issues is fixed in the new realease of LVGL.
Code to reproduce
There is no code to reproduce.