fix(refr): NOT draw if scale is 0
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
committed by
Gabor Kiss-Vamosi
parent
d6495b576b
commit
1d647adaef
@@ -273,14 +273,14 @@ lv_text_align_t lv_obj_calculate_style_text_align(const lv_obj_t * obj, lv_part_
|
|||||||
|
|
||||||
static inline int32_t lv_obj_get_style_transform_scale_x_safe(const lv_obj_t * obj, lv_part_t part)
|
static inline int32_t lv_obj_get_style_transform_scale_x_safe(const lv_obj_t * obj, lv_part_t part)
|
||||||
{
|
{
|
||||||
int16_t zoom = lv_obj_get_style_transform_scale_x(obj, part);
|
int32_t scale = lv_obj_get_style_transform_scale_x(obj, part);
|
||||||
return zoom != 0 ? zoom : 1;
|
return scale > 0 ? scale : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t lv_obj_get_style_transform_scale_y_safe(const lv_obj_t * obj, lv_part_t part)
|
static inline int32_t lv_obj_get_style_transform_scale_y_safe(const lv_obj_t * obj, lv_part_t part)
|
||||||
{
|
{
|
||||||
int16_t zoom = lv_obj_get_style_transform_scale_y(obj, part);
|
int32_t scale = lv_obj_get_style_transform_scale_y(obj, part);
|
||||||
return zoom != 0 ? zoom : 1;
|
return scale > 0 ? scale : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -923,6 +923,11 @@ static void refr_obj_matrix(lv_layer_t * layer, lv_obj_t * obj)
|
|||||||
int32_t skew_x = lv_obj_get_style_transform_skew_x(obj, 0);
|
int32_t skew_x = lv_obj_get_style_transform_skew_x(obj, 0);
|
||||||
int32_t skew_y = lv_obj_get_style_transform_skew_y(obj, 0);
|
int32_t skew_y = lv_obj_get_style_transform_skew_y(obj, 0);
|
||||||
|
|
||||||
|
if(scale_x <= 0 || scale_y <= 0) {
|
||||||
|
/* NOT draw if scale is negative or zero */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* generate the obj matrix */
|
/* generate the obj matrix */
|
||||||
lv_matrix_translate(&obj_matrix, pivot.x, pivot.y);
|
lv_matrix_translate(&obj_matrix, pivot.x, pivot.y);
|
||||||
if(rotation != 0) {
|
if(rotation != 0) {
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ lv_draw_image_dsc_t * lv_draw_task_get_image_dsc(lv_draw_task_t * task)
|
|||||||
|
|
||||||
void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
||||||
{
|
{
|
||||||
|
if(dsc->scale_x <= 0 || dsc->scale_y <= 0) {
|
||||||
|
/* NOT draw if scale is negative or zero */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
||||||
|
|
||||||
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
t->draw_dsc = lv_malloc(sizeof(*dsc));
|
||||||
@@ -90,6 +95,11 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
|||||||
}
|
}
|
||||||
if(dsc->opa <= LV_OPA_MIN) return;
|
if(dsc->opa <= LV_OPA_MIN) return;
|
||||||
|
|
||||||
|
if(dsc->scale_x <= 0 || dsc->scale_y <= 0) {
|
||||||
|
/* NOT draw if scale is negative or zero */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LV_PROFILER_BEGIN;
|
LV_PROFILER_BEGIN;
|
||||||
|
|
||||||
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
|
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
|
||||||
|
|||||||
Reference in New Issue
Block a user