-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some issues with strokeless geometry segments (#16019)
* Added failing cross test. For polyline segment with `IsStroked = false`. * Fixed some issues with non-stroked segments * Fix CombinedGeometryImpl with empty paths. If an empty (but non-null) stroke was passed to `CombinedGeometryImpl` then its empty bounds would be used and the fill bounds ignored. Added a test and fixed that. --------- Co-authored-by: Nikita Tsukanov <[email protected]>
- Loading branch information
Showing
10 changed files
with
97 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/Avalonia.Skia.UnitTests/CombinedGeometryImplTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using SkiaSharp; | ||
using Xunit; | ||
|
||
namespace Avalonia.Skia.UnitTests; | ||
|
||
public class CombinedGeometryImplTests | ||
{ | ||
[Fact] | ||
public void Combining_Fill_With_Empty_Stroke_Returns_Fill_Bounds() | ||
{ | ||
var fill = new SKPath(); | ||
fill.LineTo(100, 0); | ||
fill.LineTo(100, 100); | ||
fill.LineTo(0, 100); | ||
fill.Close(); | ||
|
||
var stroke = new SKPath(); | ||
|
||
var result = new CombinedGeometryImpl(stroke, fill); | ||
|
||
Assert.Equal(new Rect(0, 0, 100, 100), result.Bounds); | ||
} | ||
} |
Binary file added
BIN
+362 Bytes
...ests/Media/Geometry/Should_Render_PolyLineSegment_With_Strokeless_Lines.wpf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.