Problem with DoResize with Rectangle

Hello together,

I produced a rectangle and this rectangle rotates itself by 45 degrees after the rotation, if I increase this rectangle or reduce
Code:

GoView myView = new GoView();

    if(myView.DragsRealtime == false)
    {
        myView.DragsRealtime = true;
    }
myView.Dock = DockStyle.Fill;
    this.Controls.Add(myView);
    RectTest rect = new RectTest();
    PointF f = rect.Location;
    if((rect.Angle == 0) || (rect.Angle == 0) )
        {
            rect.Rotate(f,45);
        }
        
    rect.Brush = Brushes.Black;
    myView.Document.Add(rect);

the Paint Function:
public override void Paint(Graphics g, GoView view)
{
if (Math.Abs(this.Angle) > float.Epsilon)
{
using (new GraphicsStateController(g))
{

                    PointF c = this.Location;
                    g.TranslateTransform(c.X, c.Y);
                    g.RotateTransform(this.Angle);
                    g.TranslateTransform(-c.X, -c.Y);
                    base.Paint(g, view);
                    xb += 2;
                }
            }
            else
            {
                base.Paint(g, view);
            }
        }

slide yourself upward or downward

therefore I don’t know, where the problem is, I therefore rotate this rectangle on its Location, however, if I then increase from upper side therefore alters the Location points for itself a possibility gives where one can define a point, it doesn’t sight alters.

best thanks

I’m not sure why you are doing this, but it might be easier if you either used the RotatableRectangle code provided in the TheaterSeater sample that is mentioned in this forum (see Need to build a Theater seating diagram)<span =“highlight”>, or if you used the GoDrawing class in version 3, which supports rotation (among other features) and can display a rectangle (among many predefined or programmer-defined figures).

Thank your Walter for your help, the problem exists, if I increase this rectangle or therefore reduce with its RotaionPoint, i have no problem with the rectangle rotates itself about its Lokation(old X and Old Y) but after Resizing
it takes the new LocationPoints

for Example: Old.X = 3, Old.Y=4 after Resizing the LocationPoints well be (5,6)

after that the rectangle rotetes with the new Ponits and slide it to right site or left site

i hope that you understand my problem now

best thank

It’s common for an object’s Location to change when one changes its Width or its Height. That can happen even without any rotation being involved.

If you are implementing everything yourself, as your override of Paint seems to show, I don’t understand what the problem is.

If you are using GoDrawing in version 3 beta (but are you?), please describe the problem again. I do not see any bug in the behavior of the GoDrawing class when one sets the GoDrawing.UnrotatedBounds property.

Anyway, can’t you set the Location afterwards to whatever point you want?