diff --git a/Greenshot/Drawing/DrawableContainer.cs b/Greenshot/Drawing/DrawableContainer.cs
index 9ec947b19..f29bdbb5a 100644
--- a/Greenshot/Drawing/DrawableContainer.cs
+++ b/Greenshot/Drawing/DrawableContainer.cs
@@ -698,6 +698,14 @@ namespace Greenshot.Drawing {
}
}
+ ///
+ /// This method is called on a DrawableContainers when:
+ /// 1) The capture on the surface is modified in such a way, that the elements would not be placed correctly.
+ /// 2) Currently not implemented: an element needs to be moved, scaled or rotated.
+ /// This basis implementation makes sure the coordinates of the element, including the TargetGripper, is correctly rotated/scaled/translated.
+ /// But this implementation doesn't take care of any changes to the content!!
+ ///
+ ///
public virtual void Transform(Matrix matrix) {
if (matrix == null) {
return;
@@ -722,61 +730,6 @@ namespace Greenshot.Drawing {
}
}
- public virtual void Rotate(RotateFlipType rotateFlipType) {
- // somehow the rotation is the wrong way?
- int angle = 90;
- if (RotateFlipType.Rotate90FlipNone == rotateFlipType) {
- angle = 270;
- }
-
- Rectangle beforeBounds = new Rectangle(Left, Top, Width, Height);
- LOG.DebugFormat("Bounds before: {0}", beforeBounds);
- GraphicsPath translatePath = new GraphicsPath();
- translatePath.AddRectangle(beforeBounds);
- Matrix rotateMatrix = new Matrix();
- rotateMatrix.RotateAt(angle, new PointF(_parent.Width >> 1, _parent.Height >> 1));
- translatePath.Transform(rotateMatrix);
- RectangleF newBounds = translatePath.GetBounds();
- LOG.DebugFormat("New bounds by using graphics path: {0}", newBounds);
-
- int ox = 0;
- int oy = 0;
- int centerX = _parent.Width >> 1;
- int centerY = _parent.Height >> 1;
- // Transform from screen to normal coordinates
- int px = Left - centerX;
- int py = centerY - Top;
- double theta = Math.PI * angle / 180.0;
- double x1 = Math.Cos(theta) * (px - ox) - Math.Sin(theta) * (py - oy) + ox;
- double y1 = Math.Sin(theta) * (px - ox) + Math.Cos(theta) * (py - oy) + oy;
-
- // Transform from screen to normal coordinates
- px = (Left + Width) - centerX;
- py = centerY - (Top + Height);
-
- double x2 = Math.Cos(theta) * (px - ox) - Math.Sin(theta) * (py - oy) + ox;
- double y2 = Math.Sin(theta) * (px - ox) + Math.Cos(theta) * (py - oy) + oy;
-
- // Transform back to screen coordinates, as we rotate the bitmap we need to switch the center X&Y
- x1 += centerY;
- y1 = centerX - y1;
- x2 += centerY;
- y2 = centerX - y2;
-
- // Calculate to rectangle
- double newWidth = x2 - x1;
- double newHeight = y2 - y1;
-
- RectangleF newRectangle = new RectangleF(
- (float)x1,
- (float)y1,
- (float)newWidth,
- (float)newHeight
- );
- ApplyBounds(newRectangle);
- LOG.DebugFormat("New bounds by using old method: {0}", newRectangle);
- }
-
protected virtual ScaleHelper.IDoubleProcessor GetAngleRoundProcessor() {
return ScaleHelper.ShapeAngleRoundBehavior.Instance;
}
diff --git a/Greenshot/Drawing/ImageContainer.cs b/Greenshot/Drawing/ImageContainer.cs
index 7b48fe2cd..55533b9ad 100644
--- a/Greenshot/Drawing/ImageContainer.cs
+++ b/Greenshot/Drawing/ImageContainer.cs
@@ -151,20 +151,6 @@ namespace Greenshot.Drawing {
}
}
- ///
- /// Rotate the bitmap
- ///
- ///
- public override void Rotate(RotateFlipType rotateFlipType) {
- Image newImage = ImageHelper.RotateFlip(image, rotateFlipType);
- if (newImage != null) {
- // Remove all current bitmaps, also the shadow (will be recreated)
- DisposeImages();
- image = newImage;
- }
- base.Rotate(rotateFlipType);
- }
-
///
/// This checks if a shadow is already generated
///