duderstadt-lab / mars-fx

BSD 2-Clause "Simplified" License
3 stars 1 forks source link

Crash on first chart update after archive open with indicators #53

Closed karlduderstadt closed 2 years ago

karlduderstadt commented 2 years ago

Right after opening a Molecule Archive and selecting the chart settings in the molecules tab, if the molecule record has positions, the first update leads to an infinite loop. If instead you switch to the next molecule record or switch to a different tab and back, the chart will update without any problems. Similarly, if indicators is set to None, it will update without problems.

This problem only occurs during the first update. All updates afterward and entirely fine and don't seems to cause problems. It might be that indicators are trying to draw before the dataset is present. It is a puzzle what it cases an infinite loop only under these circumstances. Working through the sequence of method calls doesn't seems to reveal much.

The only solution seems to be to detect that it is the first update and make sure to perform an extra layout call before adding the indicators. This appears to fix the problem. See the commit below closing this issue.