Skip to content

Control: use locks to prevent concurrent processing of UI events#3559

Merged
swharden merged 5 commits intoScottPlot:mainfrom
chjrom:issue-3557
Apr 3, 2024
Merged

Control: use locks to prevent concurrent processing of UI events#3559
swharden merged 5 commits intoScottPlot:mainfrom
chjrom:issue-3557

Conversation

@chjrom
Copy link
Contributor

@chjrom chjrom commented Mar 29, 2024

The user control that hosts the plot can have a separate thread for rendering. For example, in AvaloniaUI.
Event processing and plot rendering are not synchronized. This results in artifacts while rendering.

This PR added a sync object to Plot to prevent multithreaded access to the plot state.

Fix #3557.

@swharden swharden changed the title Fix artifacts while panning in AvaloniaUI Control: use locks to prevent concurrent processing of UI events Apr 3, 2024
@swharden
Copy link
Member

swharden commented Apr 3, 2024

Hi @chjrom, thanks for this fix! It will be in the next release 🚀

I also like exposing the Sync object for external locking as an alternative to using the PreRenderLock event handler described in #3095

@swharden swharden merged commit 62fa4a2 into ScottPlot:main Apr 3, 2024
swharden added a commit that referenced this pull request Jul 14, 2024
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.

Avalonia: graphical artifacts during mouse interactions

2 participants