Browse Source

Workaround for ItemsRepeater producing nonsensical values

pull/3871/head
Nikita Tsukanov 6 years ago
parent
commit
75bb196b4f
  1. 7
      src/Skia/Avalonia.Skia/DrawingContextImpl.cs

7
src/Skia/Avalonia.Skia/DrawingContextImpl.cs

@ -248,6 +248,13 @@ namespace Avalonia.Skia
/// <inheritdoc />
public void DrawRectangle(IBrush brush, IPen pen, RoundedRect rect, BoxShadows boxShadows = default)
{
if (rect.Rect.Height <= 0 || rect.Rect.Width <= 0)
return;
// Arbitrary chosen values
// On OSX Skia breaks OpenGL context when asked to draw, e. g. (0, 0, 623, 6666600) rect
if (rect.Rect.Height > 8192 || rect.Rect.Width > 8192)
boxShadows = default;
var rc = rect.Rect.ToSKRect();
var isRounded = rect.IsRounded;
var needRoundRect = rect.IsRounded || (boxShadows.HasInsetShadows);

Loading…
Cancel
Save