new moving event for painting objects

This commit is contained in:
2019-12-16 11:27:36 +01:00
parent 92533152a0
commit 0fb1b0172a
2 changed files with 21 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
Imports System.Drawing
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
@@ -348,9 +349,14 @@ Public Class PaintingControl
End Sub
Private Sub UpdateObjectPosition(e As MouseEventArgs, obj As PaintingObject, sp As PointF)
obj.Location = New Point(e.X - sp.X + Offset.X,
e.Y - sp.Y + Offset.Y)
obj.RaiseMoving(New EventArgs)
Dim cancel As New CancelEventArgs(False)
obj.RaiseMovingBeforePositionUpdated(cancel)
If Not cancel.Cancel Then
obj.Location = New Point(e.X - sp.X + Offset.X,
e.Y - sp.Y + Offset.Y)
obj.RaiseMoving(New EventArgs)
End If
End Sub
Private Function IsResizingObjs(objs As IList(Of PaintingObject)) As Boolean