Skip to content

Commit

Permalink
chore(scale) Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
C47D committed Aug 19, 2024
1 parent 1cddc70 commit 538bc87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/widgets/scale/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ A round scale with multiple needles, resembling a clock
.. lv_example:: widgets/scale/lv_example_scale_6
:language: c

Customizing scale major tick labels with `LV_EVENT_DRAW_TASK_ADDED` event
Customizing scale major tick label color with `LV_EVENT_DRAW_TASK_ADDED` event
"""""""""""""""""""""""""""""""""""""""""""""""""""""""

.. lv_example:: widgets/scale/lv_example_scale_7
Expand Down
6 changes: 3 additions & 3 deletions examples/widgets/scale/lv_example_scale_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ static void draw_event_cb(lv_event_t * e)
int32_t new_w = size.x;
int32_t old_w = lv_area_get_width(&draw_task->area);

// Distribute the new size equally on both sides
/* Distribute the new size equally on both sides */
draw_task->area.x1 -= (new_w - old_w) / 2;
draw_task->area.x2 += ((new_w - old_w) + 1) / 2; // +1 for rounding
draw_task->area.x2 += ((new_w - old_w) + 1) / 2; /* +1 for rounding */

}
}
}

/**
* Customizing scale major tick labels with `LV_EVENT_DRAW_TASK_ADDED` event
* Customizing scale major tick label color with `LV_EVENT_DRAW_TASK_ADDED` event
*/
void lv_example_scale_7(void)
{
Expand Down

0 comments on commit 538bc87

Please sign in to comment.