public static Rectangle Transform(this Rectangle value, Matrix matrix) { Vector2 topLeft = value.TopLeft().ToVector2().Transform(matrix); Vector2 bottomRight = value.BottomRight().ToVector2().Transform(matrix); return(new Rectangle(topLeft.ToPoint(), (bottomRight - topLeft).ToPoint())); }