Answer the question
In order to leave comments, you need to log in
How to make the figure not climb out of the frame during transformations?
I am writing a small WPF application. It is necessary that inside the frame (Border) there is a figure (for example, Rectangle), to which certain transformations could be applied (for example, rotation by 30 degrees).
Everything worked out, but only when the figure is rotated, it goes beyond the borders of the frame.
How to fix it?
partial class AbstractShape : Border
{
public AbstractShape(in Shape shape)
{
InitializeComponent();
Child = shape;
}
}
Answer the question
In order to leave comments, you need to log in
When rotating, you also need to change the scale of the figure. And the scale itself depends on the angle of rotation, i.e. it will be a function of the angle.
Once upon a time, I did something similar, only on canvas
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question