calendar: optimize cover check in the design function

This commit is contained in:
Gabor Kiss-Vamosi
2019-05-19 10:56:21 +02:00
parent f7bc8c2328
commit b0a4fd7dad
2 changed files with 3 additions and 3 deletions

View File

@@ -2051,12 +2051,12 @@ static bool lv_obj_design(lv_obj_t * obj, const lv_area_t * mask_p, lv_design_mo
{
if(mode == LV_DESIGN_COVER_CHK) {
/*Most trivial test. The mask is fully IN the object? If no it surely not covers it*/
/*Most trivial test. Is the mask fully IN the object? If no it surely doesn't cover it*/
if(lv_area_is_in(mask_p, &obj->coords) == false) return false;
/*Can cover the area only if fully solid (no opacity)*/
const lv_style_t * style = lv_obj_get_style(obj);
if(style->body.opa != LV_OPA_COVER) return false;
if(style->body.opa < LV_OPA_MAX) return false;
/* Because of the radius it is not sure the area is covered
* Check the areas where there is no radius*/