Fixed serialization issues, and made sure the arrow / line have the right adorners.

This commit is contained in:
Robin 2016-05-23 16:43:10 +02:00
commit 9ab6bff116
23 changed files with 335 additions and 99 deletions

View file

@ -26,6 +26,7 @@ using System.Runtime.Serialization;
using Greenshot.Drawing.Fields;
using Greenshot.Helpers;
using Greenshot.Plugin.Drawing;
using Greenshot.Drawing.Adorners;
namespace Greenshot.Drawing {
/// <summary>
@ -45,15 +46,14 @@ namespace Greenshot.Drawing {
AddField(GetType(), FieldType.SHADOW, true);
}
[OnDeserialized()]
private void OnDeserialized(StreamingContext context) {
InitGrippers();
DoLayout();
protected override void OnDeserialized(StreamingContext context)
{
Init();
}
protected void Init() {
// TODO: Remove the unneeded grippers (1, 2, 3, 5, 6, 7)
Adorners.Add(new MoveAdorner(this, Positions.TopLeft));
Adorners.Add(new MoveAdorner(this, Positions.BottomRight));
}
public override void Draw(Graphics graphics, RenderMode rm) {
@ -109,8 +109,6 @@ namespace Greenshot.Drawing {
protected override ScaleHelper.IDoubleProcessor GetAngleRoundProcessor() {
return ScaleHelper.LineAngleRoundBehavior.Instance;
}
}
}
}