This commit is contained in:
2020-12-03 07:13:47 +01:00
parent badf771c47
commit 48a20cf18c

View File

@@ -291,12 +291,13 @@ Namespace PreviewN
IsMouseDown = False IsMouseDown = False
End Sub End Sub
Private Sub glControl1_MouseMove(ByVal sender As Object, ByVal e As Windows.Forms.MouseEventArgs) Handles glControlHost.MouseMove Private Sub glControl1_MouseMove(ByVal sender As Object, ByVal e As Windows.Input.MouseEventArgs) Handles glControl1.MouseMove
If IsMouseDown AndAlso e.Button = MouseButtons.Left Then If e.LeftButton = MouseButtonState.Pressed Then
Dim pos = e.GetPosition(glControl1)
If IsShiftPressed Then If IsShiftPressed Then
MyCamera.UpdateCameraOffsetWithMouse(savedCamPos, e.X, e.Y, glControl1.Width, glControl1.Height, camMtx) MyCamera.UpdateCameraOffsetWithMouse(savedCamPos, pos.X, pos.Y, glControl1.Width, glControl1.Height, camMtx)
Else Else
MyCamera.UpdateCameraMatrixWithMouse(e.X, e.Y, camMtx) MyCamera.UpdateCameraMatrixWithMouse(pos.X, pos.Y, camMtx)
End If End If
InvalidateGL() InvalidateGL()
End If End If