JetBrains-Research / jbr

JBR Genome Browser
https://doi.org/10.1093/bioinformatics/btab376
11 stars 0 forks source link

On track selection JBR always repains all tracks #207

Open iromeo opened 1 year ago

iromeo commented 1 year ago

Due to bug in org.jetbrains.bio.browser.desktop.TrackViewRenderComponent#repaintRequired the desired behaviour doesn't work. In repaintRequired there is a code that detects if only the selection was changed in the model. In past tracks rendered selection, but now selection is painted separately above track images => no need to repaint if only selection changed.

Due to bug the function doesn't work as expected:

In function org.jetbrains.bio.browser.desktop.TrackViewRenderComponent#repaintRequired is present comparison browser.uiSettings == lastResult.context, but lastResult.context refers to RenderingContext, while brower.uiSettings describes global browser settings. So they never are equal in check is always false

Suggestion: If only selection is changed, do not trigger repaint require event, e.g. in TrackListController.modelChanged() handler. Likely we need to detect that only selection changed and skip

 trackToComponentMap.values.forEach(TrackViewComponent::repaintRequired)

invocation.

modelChanged