Skip to content

Commit

Permalink
Fix invalidation after hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualMelon committed Feb 5, 2023
1 parent e2adfb2 commit 1970da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/OxyPlot.Avalonia/PlotBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public void InvalidatePlot(bool updateData = true)
{
if (Interlocked.CompareExchange(ref isUpdateRequired, updateState, currentState) == currentState)
{
isUpdateRequired = updateState;
BeginInvoke(() => UpdateModel(updateData));
break;
}
Expand Down Expand Up @@ -396,6 +395,7 @@ protected void UpdateModel(bool updateData = true)
{
if (Width <= 0 || Height <= 0 || ActualModel == null)
{
isUpdateRequired = 0;
return;
}

Expand All @@ -405,7 +405,7 @@ protected void UpdateModel(bool updateData = true)

if (updateState > 0)
{
((IPlotModel)ActualModel).Update(updateState == 2);
((IPlotModel)ActualModel).Update(updateState == 2 || updateData);
}
}

Expand All @@ -415,7 +415,6 @@ protected void UpdateModel(bool updateData = true)
// After the invalidation, the element will have its layout updated,
// which will occur asynchronously unless subsequently forced by UpdateLayout.
BeginInvoke(InvalidateArrange);
BeginInvoke(InvalidateVisual);
}

}
Expand Down

0 comments on commit 1970da2

Please sign in to comment.