Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path Geometry update fix for 4748 bug rerender on change for paths segments #18025

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add failing Path Geometry update test
#4748 [BUG] Rerender on change for Paths, Segments and e.g.
Failing Test
  • Loading branch information
EvanRuiz committed Jan 22, 2025
commit f38cd3b60afc7b7c6bef62757aa5776a88cd18bb
32 changes: 32 additions & 0 deletions tests/Avalonia.Base.UnitTests/Media/PathGeometryTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Avalonia.Media;
using Xunit;

namespace Avalonia.Base.UnitTests.Media;

public class PathGeometryTests
{
[Fact]
public void PathGeometry_Triggers_Invalidation_On_Figures_Add()
{
var segment = new PolyLineSegment()
{
Points = [new Point(1, 1), new Point(2, 2)]
};

var figure = new PathFigure()
{
Segments = [segment],
IsClosed = false,
IsFilled = false,
};

var target = new PathGeometry();

var changed = false;

target.Changed += (_, _) => { changed = true; };

target.Figures?.Add(figure);
Assert.True(changed);
}
}