Skip to content

Commit

Permalink
Fix ClipperView background color issue (dotnet#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
myroot authored and rookiejava committed Apr 6, 2022
1 parent 8ff9621 commit b13d656
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Core/src/Graphics/MauiDrawable.Tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void Draw(ICanvas canvas, RectF dirtyRect)
{
canvas.SaveState();
Color color = Shadow.Paint.ToColor() != null ? Shadow.Paint.ToColor()!.MultiplyAlpha(Shadow.Opacity) : Colors.Black.MultiplyAlpha(Shadow.Opacity);
canvas.FillColor = color;
canvas.SetShadow(
new SizeF((float)Shadow.Offset.X, (float)Shadow.Offset.Y),
(int)Shadow.Radius,
Expand Down
5 changes: 3 additions & 2 deletions src/Core/src/Platform/Tizen/WrapperView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ partial void ClipChanged()
((MauiDrawable)_drawableCanvas.Value.Drawable).Clip = Clip;
UpdateDrawableCanvas(false);
}
_clipperView.Value.Invalidate();

if (_clipperView.IsValueCreated || Clip is not null)
_clipperView.Value.Invalidate();
}

void UpdateDrawableCanvas(Paint? paint)
Expand Down Expand Up @@ -132,7 +134,6 @@ void OnClipPaint(object? sender, DrawClipEventArgs e)
var clipPath = Clip?.PathForBounds(new Rect(0, 0, width, height)) ?? null;
if (clipPath == null)
{
canvas.FillRectangle(e.DirtyRect);
return;
}
canvas.FillPath(clipPath);
Expand Down

0 comments on commit b13d656

Please sign in to comment.