Made transformations work for most elements.

This commit is contained in:
RKrom 2014-06-01 22:16:39 +02:00
commit d731d151c8

View file

@ -702,19 +702,23 @@ namespace Greenshot.Drawing {
if (matrix == null) { if (matrix == null) {
return; return;
} }
Point center = new Point(Left + (Width/2), Top + (Height/2)); Point topLeft = new Point(Left, Top);
Point bottomRight = new Point(Left + Width, Top + Height);
Point[] points; Point[] points;
if (TargetGripper != null) { if (TargetGripper != null) {
points = new[] {center, TargetGripper.Location}; points = new[] {topLeft, bottomRight, TargetGripper.Location};
} else { } else {
points = new[] { center}; points = new[] { topLeft, bottomRight };
} }
matrix.TransformPoints(points); matrix.TransformPoints(points);
Location = new Point(points[0].X - (Width/2), points[0].Y - (Height/2)); Left = points[0].X;
Top = points[0].Y;
Width = points[1].X - points[0].X;
Height = points[1].Y - points[0].Y;
if (TargetGripper != null) { if (TargetGripper != null) {
TargetGripper.Location = points[1]; TargetGripper.Location = points[points.Length-1];
} }
} }