This commit is contained in:
2021-03-17 10:24:34 +01:00
parent 45696f2d19
commit 6871d6952f
3 changed files with 29 additions and 3 deletions

View File

@@ -314,7 +314,7 @@ Public Class PaintingControl
Private Sub SaveObjectPositions(e As MouseEventArgs, objs As IList)
For Each obj As PaintingObject In objs
If Not savedPos.ContainsKey(obj) Then
If Not obj.HardcodedLocation AndAlso Not savedPos.ContainsKey(obj) Then
savedPos.Add(obj, New PointF(e.X - obj.Location.X + Offset.X, e.Y - obj.Location.Y + Offset.Y))
SaveObjectPositions(e, obj.PinnedObjects)
End If

View File

@@ -42,7 +42,8 @@ Imports Newtonsoft.Json
<JsonIgnore> Public Property BufferedImage As Image = Nothing
Public Property ImageSizeMode As ImageSizeMode
Public Property ImageProperties As New PaintingObjectImageProperties
Public Property Tag As String = Nothing
<JsonIgnore>
Public Property Tag As Object = Nothing
Public Property Name As String = ""
Public ReadOnly Property PinnedObjects As New List(Of PaintingObject)
<JsonIgnore>
@@ -51,6 +52,7 @@ Imports Newtonsoft.Json
Public ReadOnly Property DrawSelectionMethode As DelegateDrawPaintingObjectMethode = AddressOf DefaultDrawMethodes.DrawSelection
Public Property Cursor As Cursor = Cursors.Default
Public Property HardcodedSize As Boolean = False
Public Property HardcodedLocation As Boolean = False
<JsonProperty>
Private _Visible As Boolean = True
<JsonProperty>
@@ -421,6 +423,20 @@ Imports Newtonsoft.Json
End Set
End Property
<JsonProperty(NameOf(Tag))>
Public Property TagString As String
Get
If TypeOf Tag Is String Then
Return Tag
Else
Return String.Empty
End If
End Get
Set(value As String)
Tag = value
End Set
End Property
Public Property EnableResize As Boolean
Get
If resizeEngine Is Nothing Then