dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.06k stars 1.17k forks source link

"ArcSegment" can't be drawn semi-circle correctly along the circle #3419

Open chen9835 opened 4 years ago

chen9835 commented 4 years ago
miloush commented 4 years ago

That is because the Ellipse is filling the whole Grid that grows bigger because of the arc stroke. It then uses the Stretch property to decide how to fill into the extra space. It is asymmetrical because the stroke normally counts into the path size, except that you force it to go negative on the left side.

If you change the stroke thickness of the ellipse and look at its line in the designer, you will see that it positions the ellipse so that it fits into the size including the stroke. That's what you need to do with your path.

You have two possible solutions:

chen9835 commented 4 years ago

@miloush Thanks. I has tried, it works well. image