mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 04:59:30 -07:00
Fixes #322. Ellipse only created default adorners in constructor, never after deserialization. Having zero adorners triggered a Linq exception down the code path. Fixed by duplicating the deserialization logic from RectangleContainer. Highlight also failed to create its default adorners. Fixed by just adding a correct call to CreateDefaultAdorners call in the existing Init method.
This commit is contained in:
parent
e9d1e278e6
commit
f71499c9c6
2 changed files with 13 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
using Greenshot.Base.Interfaces.Drawing;
|
using Greenshot.Base.Interfaces.Drawing;
|
||||||
using Greenshot.Editor.Drawing.Fields;
|
using Greenshot.Editor.Drawing.Fields;
|
||||||
using Greenshot.Editor.Helpers;
|
using Greenshot.Editor.Helpers;
|
||||||
|
@ -35,6 +36,17 @@ namespace Greenshot.Editor.Drawing
|
||||||
public class EllipseContainer : DrawableContainer
|
public class EllipseContainer : DrawableContainer
|
||||||
{
|
{
|
||||||
public EllipseContainer(Surface parent) : base(parent)
|
public EllipseContainer(Surface parent) : base(parent)
|
||||||
|
{
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDeserialized(StreamingContext streamingContext)
|
||||||
|
{
|
||||||
|
base.OnDeserialized(streamingContext);
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init()
|
||||||
{
|
{
|
||||||
CreateDefaultAdorners();
|
CreateDefaultAdorners();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@ namespace Greenshot.Editor.Drawing
|
||||||
{
|
{
|
||||||
FieldChanged += HighlightContainer_OnFieldChanged;
|
FieldChanged += HighlightContainer_OnFieldChanged;
|
||||||
ConfigurePreparedFilters();
|
ConfigurePreparedFilters();
|
||||||
|
CreateDefaultAdorners();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void HighlightContainer_OnFieldChanged(object sender, FieldChangedEventArgs e)
|
protected void HighlightContainer_OnFieldChanged(object sender, FieldChangedEventArgs e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue