I have a five-pointed star.
<ed:RegularPolygon x:Name="regularPolygon" Fill="{StaticResource RatingButtonNormalFill}" InnerRadius="0.55" PointCount="5" Stroke="Black" StrokeThickness="0.5" RenderTransformOrigin="0.5,0.5" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"> There is a problem with her. On the form it is small (20x20) and it rotates when clicked. So when rotating it seems to shift a little.
I suppose that this is due to the fact that when a star rotates, the dimensions of the rectangle describing it change (the container does not rotate with it) and it adjusts its dimensions on the move. I do not know what to do with yet. Maybe this is not the reason.
UPD
I guessed the reason. The star does not fit into the square. Here, I will show with the example of a regular pentagon and a square what is happening. Here is an image without turning.
But I turned the pentagon at 72 degrees (that is, to be at the top of its next vertex).
I don't know what to do with this yet.
UPD2
In short, I found a geometric solution ... I just need to transfer it to xaml. The point is that the square in which I have a star should describe the circle in which the star is inscribed. How to transfer it to xaml I do not know :(
UPD3
It is necessary to transfer the center of rotation to the center of the circle describing the star. The circle itself is of course not. It is necessary to change the property RenderTransformOrigin="0.5,0.5" , but I still do not know what





RenderTransform, the sizes do not change. Apparently,ed:RegularPolygondoes not accurately center your star. Show his code. - VladDed:RegularPolygon. Let's get his code :) - VladD