From 401cc688d678b0623e6d8bf534c1906bffb93de1 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 19 Jan 2018 13:43:39 -0800 Subject: [PATCH] Make sure we can use the shift key to switch to pan --- PartPreviewWindow/View3D/View3DWidget.cs | 84 ++++++++++++------------ Submodules/agg-sharp | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index c6eda6f5d..e8a821dbc 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -968,6 +968,48 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } + public override void OnMouseMove(MouseEventArgs mouseEvent) + { + // File system Drop validation + mouseEvent.AcceptDrop = this.AllowDragDrop() + && mouseEvent.DragFiles?.Count > 0 + && mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath)); + + // View3DWidgets Filesystem DropDrop handler + if (mouseEvent.AcceptDrop + && this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y)) + { + if (this.DragOperationActive) + { + DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position)); + } + else + { + // Project DragFiles to IEnumerable + this.StartDragDrop( + mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)), + screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position), + trackSourceFiles: true); + } + } + + if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None) + { + DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y)); + } + + if (DragSelectionInProgress) + { + DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget(); + DragSelectionEndPosition = new Vector2( + Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), + Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); + Invalidate(); + } + + base.OnMouseMove(mouseEvent); + } + public IntersectInfo GetIntersectPosition(Vector2 screenSpacePosition) { //Vector2 meshViewerWidgetScreenPosition = meshViewerWidget.TransformFromParentSpace(this, new Vector2(mouseEvent.X, mouseEvent.Y)); @@ -1058,48 +1100,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } } - public override void OnMouseMove(MouseEventArgs mouseEvent) - { - // File system Drop validation - mouseEvent.AcceptDrop = this.AllowDragDrop() - && mouseEvent.DragFiles?.Count > 0 - && mouseEvent.DragFiles.TrueForAll(filePath => ApplicationController.Instance.IsLoadableFile(filePath)); - - // View3DWidgets Filesystem DropDrop handler - if (mouseEvent.AcceptDrop - && this.PositionWithinLocalBounds(mouseEvent.X, mouseEvent.Y)) - { - if (this.DragOperationActive) - { - DragOver(screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position)); - } - else - { - // Project DragFiles to IEnumerable - this.StartDragDrop( - mouseEvent.DragFiles.Select(path => new FileSystemFileItem(path)), - screenSpaceMousePosition: this.TransformToScreenSpace(mouseEvent.Position), - trackSourceFiles: true); - } - } - - if (CurrentSelectInfo.DownOnPart && this.TrackballTumbleWidget.TransformState == TrackBallController.MouseDownType.None) - { - DragSelectedObject(new Vector2(mouseEvent.X, mouseEvent.Y)); - } - - if (DragSelectionInProgress) - { - DragSelectionEndPosition = mouseEvent.Position - OffsetToMeshViewerWidget(); - DragSelectionEndPosition = new Vector2( - Math.Max(Math.Min(DragSelectionEndPosition.X, meshViewerWidget.LocalBounds.Right), meshViewerWidget.LocalBounds.Left), - Math.Max(Math.Min(DragSelectionEndPosition.Y, meshViewerWidget.LocalBounds.Top), meshViewerWidget.LocalBounds.Bottom)); - Invalidate(); - } - - base.OnMouseMove(mouseEvent); - } - Vector2 OffsetToMeshViewerWidget() { List parents = new List(); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 9b89cd664..7fd54159b 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 9b89cd664f4d642229459fa9e86d6c8aa201e5d4 +Subproject commit 7fd54159b5795c89203a516fe551347f5708a831