Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rendering for text labels #226

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

hoangphamEclipse
Copy link
Contributor

Currently, when the timeline chart renders text labels for states, it deletes all existing labels, then creates new labels, and adds them to the graph. This is not efficient and makes rendering of the labels sluggish when zooming in and out of the graph. This commit removes the code that delete the text labels objects on every re-render, and updates the text content of the labels instead of re-creating them.

Fixes #225.

Signed-off-by: Hoang Thuan Pham hoang.pham@calian.ca

Currently, when the timeline chart renders text labels for states, it deletes all
existing labels, then creates new labels, and adds them to the graph. This is not
efficient and makes rendering of the labels sluggish when zooming in and out of the
graph. This commit removes the code that delete the text labels objects on every
re-rerender, and updates the text content of the labels instead of re-creating them.

Fixes eclipse-cdt-cloud#225.

Signed-off-by: Hoang Thuan Pham <hoang.pham@calian.ca>
Copy link
Collaborator

@bhufmann bhufmann left a comment

Choose a reason for hiding this comment

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

It looks good to me. It improves the overall performance when many labels have to be re-drawn in a short time.

Copy link
Contributor

@MatthewKhouzam MatthewKhouzam left a comment

Choose a reason for hiding this comment

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

Every state has a label, this is a great first step, now can we make every label part of a map in the view. We can look it up at the construction time, knowing our size and text. So "HoangThuanPham" would save labels for "HoangThuanPham", "HoangThuan..." "HoangThua..." "HoangThu..." "HoangTh..." "HoangT..." "Hoang..." etc... then instead of doing a new labelobject at line 76, you make a lookup in the view.

Just a thought for later.

Approved

@bhufmann
Copy link
Collaborator

Every state has a label, this is a great first step, now can we make every label part of a map in the view. We can look it up at the construction time, knowing our size and text. So "HoangThuanPham" would save labels for "HoangThuanPham", "HoangThuan..." "HoangThua..." "HoangThu..." "HoangTh..." "HoangT..." "Hoang..." etc... then instead of doing a new labelobject at line 76, you make a lookup in the view.

Just a thought for later.

Approved

Interesting suggestion for caching BitmapText objects to avoid costly updating of a single BitmapText. I'll create a issue tracker from this comment and we can pick-up later.

@bhufmann bhufmann merged commit 266fb6b into eclipse-cdt-cloud:master Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repeated scrolling with mouse wheel causes UI to freeze due label rendering
3 participants