Skip to content

Commit c5ba480

Browse files
authored
Fix invalidation after hidden (#53)
1 parent a9d7854 commit c5ba480

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Source/OxyPlot.Avalonia/PlotBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ public void InvalidatePlot(bool updateData = true)
237237
{
238238
if (Interlocked.CompareExchange(ref isUpdateRequired, updateState, currentState) == currentState)
239239
{
240-
isUpdateRequired = updateState;
241240
BeginInvoke(() => UpdateModel(updateData));
242241
break;
243242
}
@@ -394,6 +393,7 @@ protected void UpdateModel(bool updateData = true)
394393
{
395394
if (Width <= 0 || Height <= 0 || ActualModel == null)
396395
{
396+
isUpdateRequired = 0;
397397
return;
398398
}
399399

@@ -403,7 +403,7 @@ protected void UpdateModel(bool updateData = true)
403403

404404
if (updateState > 0)
405405
{
406-
((IPlotModel)ActualModel).Update(updateState == 2);
406+
((IPlotModel)ActualModel).Update(updateState == 2 || updateData);
407407
}
408408
}
409409

@@ -413,7 +413,6 @@ protected void UpdateModel(bool updateData = true)
413413
// After the invalidation, the element will have its layout updated,
414414
// which will occur asynchronously unless subsequently forced by UpdateLayout.
415415
BeginInvoke(InvalidateArrange);
416-
BeginInvoke(InvalidateVisual);
417416
}
418417

419418
}

0 commit comments

Comments
 (0)