Skip to content

Commit

Permalink
Merge pull request #2677 from cwensley/curtis/mac-fix-colorize-when-s…
Browse files Browse the repository at this point in the history
…ize-changed

Mac: Fix crash when setting background color on some controls and size changes to zero
  • Loading branch information
cwensley committed Aug 29, 2024
2 parents 180619d + da9a9dc commit acc5d2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Eto.Mac/ColorizeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public void Begin(CGRect frame, NSView controlView)
var size = controlView.Frame.Size;
if (size.Width <= 0 || size.Height <= 0)
{
_image?.Dispose();
_image = null;
return;
}

if (_image == null || size != _image.Size)
{
if (_image != null)
_image.Dispose();

_image?.Dispose();
_image = new NSImage(size);
}

Expand Down

0 comments on commit acc5d2b

Please sign in to comment.