mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
FEATURE-863: Trying to get it working in 1.2.9
This commit is contained in:
parent
a80e4e2a26
commit
f2f37700b3
11 changed files with 77 additions and 14 deletions
|
@ -27,6 +27,7 @@ using System.Drawing;
|
|||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Text;
|
||||
using System.Runtime.Serialization;
|
||||
using GreenshotPlugin.Interfaces.Drawing;
|
||||
|
||||
namespace Greenshot.Drawing {
|
||||
/// <summary>
|
||||
|
@ -48,9 +49,19 @@ namespace Greenshot.Drawing {
|
|||
Init();
|
||||
}
|
||||
|
||||
private void UpdateCounterOnFieldChanged(object sender, FieldChangedEventArgs fieldChangedEventArgs)
|
||||
{
|
||||
if (Equals(fieldChangedEventArgs.Field.FieldType, FieldType.COUNTER_START))
|
||||
{
|
||||
Parent.CounterStart = (int)fieldChangedEventArgs.Field.Value;
|
||||
}
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
CreateDefaultAdorners();
|
||||
FieldChanged -= UpdateCounterOnFieldChanged;
|
||||
FieldChanged += UpdateCounterOnFieldChanged;
|
||||
}
|
||||
|
||||
#region Number serializing
|
||||
|
@ -102,9 +113,14 @@ namespace Greenshot.Drawing {
|
|||
}
|
||||
((Surface) Parent)?.RemoveStepLabel(this);
|
||||
base.SwitchParent(newParent);
|
||||
if (Parent != null)
|
||||
{
|
||||
Parent.CounterStart = GetFieldValueAsInt(FieldType.COUNTER_START);
|
||||
}
|
||||
if (newParent != null) {
|
||||
((Surface)Parent)?.AddStepLabel(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override Size DefaultSize => new Size(30, 30);
|
||||
|
@ -134,6 +150,7 @@ namespace Greenshot.Drawing {
|
|||
protected override void InitializeFields() {
|
||||
AddField(GetType(), FieldType.FILL_COLOR, Color.DarkRed);
|
||||
AddField(GetType(), FieldType.LINE_COLOR, Color.White);
|
||||
AddField(GetType(), FieldType.COUNTER_START, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue