This commit is contained in:
2019-12-16 11:36:09 +01:00
parent 0fb1b0172a
commit f4bf6c4066

View File

@@ -335,8 +335,9 @@ Public Class PaintingControl
Dim sp As PointF = savedPos(obj) Dim sp As PointF = savedPos(obj)
If Not movedObjs.Contains(obj) Then If Not movedObjs.Contains(obj) Then
UpdateObjectPosition(e, obj, sp) If UpdateObjectPosition(e, obj, sp) Then
movedObjs.Add(obj) movedObjs.Add(obj)
End If
End If End If
If obj.PinnedObjects.Count > 0 Then If obj.PinnedObjects.Count > 0 Then
@@ -348,7 +349,8 @@ Public Class PaintingControl
ResumeDrawing(False) ResumeDrawing(False)
End Sub End Sub
Private Sub UpdateObjectPosition(e As MouseEventArgs, obj As PaintingObject, sp As PointF) Private Function UpdateObjectPosition(e As MouseEventArgs, obj As PaintingObject, sp As PointF) As Boolean
Dim moved As Boolean = False
Dim cancel As New CancelEventArgs(False) Dim cancel As New CancelEventArgs(False)
obj.RaiseMovingBeforePositionUpdated(cancel) obj.RaiseMovingBeforePositionUpdated(cancel)
@@ -356,8 +358,11 @@ Public Class PaintingControl
obj.Location = New Point(e.X - sp.X + Offset.X, obj.Location = New Point(e.X - sp.X + Offset.X,
e.Y - sp.Y + Offset.Y) e.Y - sp.Y + Offset.Y)
obj.RaiseMoving(New EventArgs) obj.RaiseMoving(New EventArgs)
moved = True
End If End If
End Sub
Return moved
End Function
Private Function IsResizingObjs(objs As IList(Of PaintingObject)) As Boolean Private Function IsResizingObjs(objs As IList(Of PaintingObject)) As Boolean
For Each obj As PaintingObject In objs For Each obj As PaintingObject In objs