Open ramezgerges opened 2 hours ago
I've reduced the render cycle to drawing the visual of the Path
only and it still reproduced. Here are the insane results of this investigation:
session.Canvas.DrawPath(geometryWithTransformations, fillPaint)
inside CompositionSpriteShape.skia.cs
, which actually draws the path. The code is accurate and works on WPF as mentioned above, but it somehow completely ignores the SKCanvas
's current clipping. The canvas's clip numbers are accurate, they're just ignored as if the clip rect didn't exist.
session.Canvas.DrawPath(SKPath.ParseSvgPathData(geometryWithTransformations.ToSvgPathData()), fillPaint);
which just encodes the SKPath to svg and decodes it again makes things work correctly!!! This, however, doesn't work:
session.Canvas.DrawPath(new SKPath(geometryWithTransformations), fillPaint);
SKPaint
. Replacing the problematic line with
session.Canvas.DrawPath(SKPath.ParseSvgPathData(geometryWithTransformations.ToSvgPathData()), new SKPaint() { Color: SKColors.Red });
fixes the bug too.
IsAntiAlias
on the SKPaint
to false. (╯°□°)╯︵ ┻━┻
Current behavior
In the repro below, scrolling the scrollviewer will make the
Path
inside remain visible even though it should be partially clipped. The shocking part is that this only happens on Linux. The WPF target on Windows clips accurately. Note that the repro seems to be very stable. I've tried a bunch of variations and they all repro 100% of the time.The problem was originally discovered in SamplesApp (notice the unclipped chevron):
Expected behavior
The
Path
should only be visible within the viewport of the ScrollViewer.How to reproduce it (as minimally and precisely as possible)
Workaround
No response
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
No response
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response