Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AndreCostaaa
Copy link
Collaborator

@AndreCostaaa AndreCostaaa commented Dec 15, 2025

Fixes #9210

Before:

image

After:

image

Notes

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@github-actions
Copy link
Contributor

Hi 👋, thank you for your PR!

We've run benchmarks in an emulated environment. Here are the results:

ARM Emulated 32b - lv_conf_perf32b

Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
All scenes avg. 28 37 7 7 0
Detailed Results Per Scene
Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
Empty screen 11 33 0 0 0
Moving wallpaper 2 33 1 1 0
Single rectangle 0 50 0 0 0
Multiple rectangles 0 33 0 0 0
Multiple RGB images 0 39 0 0 0
Multiple ARGB images 9 42 2 2 0
Rotated ARGB images 56 44 15 15 0
Multiple labels 6 35 0 0 0
Screen sized text 97 47 20 20 0
Multiple arcs 32 33 7 7 0
Containers 4 37 0 0 0
Containers with overlay 88 21 44 44 0
Containers with opa 16 37 1 1 0
Containers with opa_layer 17 34 5 5 0
Containers with scrolling 45 45 12 12 0
Widgets demo 70 40 (+1) 16 16 0
All scenes avg. 28 37 7 7 0

ARM Emulated 64b - lv_conf_perf64b

Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
All scenes avg. 25 (+1) 37 6 6 0
Detailed Results Per Scene
Scene Name Avg CPU (%) Avg FPS Avg Time (ms) Render Time (ms) Flush Time (ms)
Empty screen 11 33 0 0 0
Moving wallpaper 1 33 0 0 0
Single rectangle 0 50 0 0 0
Multiple rectangles 0 35 0 0 0
Multiple RGB images 0 39 0 0 0
Multiple ARGB images 9 (+3) 40 (-2) 0 0 0
Rotated ARGB images 32 (+3) 33 (-1) 9 9 0
Multiple labels 1 33 0 0 0
Screen sized text 83 (+2) 46 18 18 0
Multiple arcs 40 (+8) 33 6 6 0
Containers 4 (+3) 38 (+1) 0 0 0
Containers with overlay 88 (-9) 23 (+1) 41 41 0
Containers with opa 15 (-1) 38 (+1) 1 (+1) 1 (+1) 0
Containers with opa_layer 8 (-1) 36 (-1) 2 2 0
Containers with scrolling 45 (-3) 47 11 (-1) 11 (-1) 0
Widgets demo 66 (-1) 41 (+1) 15 15 0
All scenes avg. 25 (+1) 37 6 6 0

Disclaimer: These benchmarks were run in an emulated environment using QEMU with instruction counting mode.
The timing values represent relative performance metrics within this specific virtualized setup and should
not be interpreted as absolute real-world performance measurements. Values are deterministic and useful for
comparing different LVGL features and configurations, but may not correlate directly with performance on
physical hardware. The measurements are intended for comparative analysis only.


🤖 This comment was automatically generated by a bot.

lv_textarea_t * ta = (lv_textarea_t *)obj;

lv_point_t cur_pos;
lv_obj_update_layout(ta->label);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it? LV_EVENT_SIZE_CHANGED should update the cursor position when deferred size calculation happened?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do as the label now only updates the size when we update its layout. It's a recent change

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the textarea widget doesn't properly scroll to the cursor position when style properties change. The fix ensures that when style-related changes occur (such as font size, padding modifications), the textarea updates its layout and repositions the scroll view to keep the cursor visible.

Key Changes:

  • Added LV_EVENT_STYLE_CHANGED event handling to trigger cursor position scrolling
  • Added lv_obj_update_layout(ta->label) call to ensure label layout is updated before calculating cursor position
  • Minor code organization improvement by moving includes after the feature guard

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
src/widgets/textarea/lv_textarea.c Added STYLE_CHANGED event handling and layout update to ensure cursor scrolls to correct position when styles change; reorganized includes after feature guard
tests/src/test_cases/widgets/test_textarea.c Added test case to verify textarea doesn't unnecessarily scroll when text is fully visible
tests/ref_imgs/widgets/textarea_1.png Reference screenshot for the new test case (software renderer)
tests/ref_imgs_vg_lite/widgets/textarea_1.png Reference screenshot for the new test case (VG-Lite renderer)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AndreCostaaa AndreCostaaa merged commit e23b7be into lvgl:master Jan 19, 2026
50 checks passed
@AndreCostaaa AndreCostaaa deleted the fix-textarea branch January 19, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

textarea alignment anomaly

3 participants