Refactoring the interop code to a separate project. Still need to add the interop DLL to the final exe... or maybe I want to use references inside the projects...

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1690 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-03-06 17:45:50 +00:00
commit 5f9deb2f06
67 changed files with 564 additions and 502 deletions

View file

@ -34,6 +34,7 @@ namespace Greenshot.Drawing {
/// </summary>
[Serializable()]
public class FreehandContainer : DrawableContainer {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FreehandContainer));
private static readonly float [] POINT_OFFSET = new float[]{0.5f, 0.25f, 0.75f};
[NonSerialized]
@ -168,6 +169,27 @@ namespace Greenshot.Drawing {
myBounds = Rectangle.Round(freehandPath.GetBounds());
}
public override void Rotate(RotateFlipType rotateFlipType) {
int angle = 270;
if (rotateFlipType == RotateFlipType.Rotate90FlipNone) {
angle = 90;
}
LOG.DebugFormat("Bounds before: {0} - {1}", Bounds, freehandPath.GetBounds());
Matrix rotateMatrix = new Matrix();
rotateMatrix.Translate(-(parent.Width >> 1), -(parent.Height >> 1));
freehandPath.Transform(rotateMatrix);
rotateMatrix = new Matrix();
rotateMatrix.Rotate(360 - angle);
freehandPath.Transform(rotateMatrix);
rotateMatrix = new Matrix();
rotateMatrix.Translate(parent.Height >> 1, parent.Width >> 1);
freehandPath.Transform(rotateMatrix);
LOG.DebugFormat("Bounds after: {0} - {1}", Bounds, freehandPath.GetBounds());
//base.Rotate(rotateFlipType);
}
/// <summary>
/// Do the drawing of the freehand "stroke"
/// </summary>