public static RectangleF PerformCenteredRotation( ref RadMatrix matrix, RectangleF bounds, float angle) { SizeF sz = new SizeF(bounds.Width / 2f, bounds.Height / 2f); matrix.RotateAt(angle, PointF.Add(bounds.Location, sz), MatrixOrder.Append); return(TelerikHelper.GetBoundingRect(bounds, matrix)); }
public RectangleF GetTransformedBounds(RectangleF bounds) { RadMatrix identity = RadMatrix.Identity; if (this.ScaleTransform != this.defaultScaleTransform) { identity.Translate(-bounds.X, -bounds.Y, MatrixOrder.Append); identity.Scale(this.ScaleTransform.Width, this.ScaleTransform.Height, MatrixOrder.Append); identity.Translate(bounds.X, bounds.Y, MatrixOrder.Append); } if ((double)this.AngleTransform != 0.0) { SizeF sz = new SizeF(bounds.Width / 2f, bounds.Height / 2f); identity.RotateAt(this.AngleTransform, PointF.Add(bounds.Location, sz), MatrixOrder.Append); RectangleF boundingRect = TelerikHelper.GetBoundingRect(bounds, identity); identity.Translate(bounds.X - boundingRect.X, bounds.Y - boundingRect.Y, MatrixOrder.Append); } return(identity.TransformRectangle(bounds)); }