improve progress circle

This commit is contained in:
lixianjing 2022-02-07 11:45:09 +08:00
parent b32e2ba26f
commit 02a9dfe91c

View File

@ -113,6 +113,10 @@ rect_t progress_circle_calc_text_dirty_rect(widget_t* widget) {
canvas_t* c = widget_get_canvas(widget);
progress_circle_t* progress_circle = PROGRESS_CIRCLE(widget);
if (widget->w < 1 || widget->h < 1) {
return r;
}
if (c != NULL && progress_circle->show_text) {
wstr_t* text = &(widget->text);
widget_prepare_text_style(widget, c);
@ -145,6 +149,10 @@ rect_t progress_circle_calc_line_dirty_rect(widget_t* widget, float_t old_value,
start_angle = progress_circle_value_to_angle(widget, old_value);
end_angle = progress_circle_value_to_angle(widget, new_value);
if (widget->w < 1 || widget->h < 1) {
return rect;
}
if (start_angle > end_angle) {
float_t t = start_angle;
start_angle = end_angle;