Skip to content

Commit

Permalink
Only update barcode image if the desired size changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Aug 5, 2022
1 parent 146479c commit fe68ff0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ZXing.Net.MAUI/BarcodeGeneratorViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public override void PlatformArrange(Rect rect)
{
base.PlatformArrange(rect);

// Don't update if it's the same size, otherwise we could infinite loop
if (desiredSize.Width == rect.Width && desiredSize.Height == rect.Height)
return;

desiredSize = rect.Size;

UpdateBarcode();
Expand Down

0 comments on commit fe68ff0

Please sign in to comment.