aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Diaz <carlos.santiago.diaz@gmail.com>2024-08-12 06:52:12 -0600
committerGitHub <noreply@github.com>2024-08-12 14:52:12 +0200
commit5cc4aec82af40fd6b2f4433f0768052229b14018 (patch)
treeba333580d7ec4cfae2cf98d4e50853c158f49ff5
parentcd9ff84788fd3ead80316cd0f083155334ab1295 (diff)
downloadlvgl-5cc4aec82af40fd6b2f4433f0768052229b14018.tar.gz
lvgl-5cc4aec82af40fd6b2f4433f0768052229b14018.zip
docs(scale): Add note about major tick label calculation when no custom labels are set (#6585)
-rw-r--r--docs/widgets/scale.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/widgets/scale.rst b/docs/widgets/scale.rst
index 48b5cb9bb..274771cf4 100644
--- a/docs/widgets/scale.rst
+++ b/docs/widgets/scale.rst
@@ -58,10 +58,14 @@ If instead of a numerical value in the major ticks a text is required they can b
with :cpp:expr:`lv_scale_set_text_src(scale, custom_labels)` using ``NULL`` as the last element,
i.e. :cpp:expr:`static char * custom_labels[3] = {"One", "Two", NULL};`.
+<strong> NOTE: </strong> The major tick value is calculated with the :cpp:expr:`lv_map` API (when not setting the custom labels),
+this calculation takes into consideration the total tick number and the scale range, so the label drawn can present rounding errors
+when the calculated value is a float number.
+
The length of the ticks can be configured with the length style property on the :cpp:enumerator:`LV_PART_INDICATOR`
for major ticks and :cpp:enumerator:`LV_PART_ITEMS` for minor ticks, for example with local style:
:cpp:expr:`lv_obj_set_style_length(scale, 5, LV_PART_INDICATOR);` for major ticks
-and :cpp:expr:`lv_obj_set_style_length(scale, 5, LV_PART_ITEMS);` for minor ticks.
+and :cpp:expr:`lv_obj_set_style_length(scale, 5, LV_PART_ITEMS);` for minor ticks.
Sections
--------