From efade42f166a4acc001dee330f6fd148eca41b27 Mon Sep 17 00:00:00 2001 From: fortsnek9348 Date: Fri, 8 Apr 2022 19:01:39 +0100 Subject: [PATCH] Use Math.Round for snap rounding. --- MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs | 4 ++-- Submodules/agg-sharp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index 5d4d04ebf..9cd362eef 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -1785,7 +1785,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } double xToSnap = xSnapOffset + delta.X; - double snappedX = ((int)((xToSnap / snapGridDistance) + .5)) * snapGridDistance; + double snappedX = Math.Round(xToSnap / snapGridDistance) * snapGridDistance; delta.X = snappedX - xSnapOffset; double ySnapOffset = selectedBounds.MinXYZ.Y; @@ -1798,7 +1798,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow } double yToSnap = ySnapOffset + delta.Y; - double snappedY = ((int)((yToSnap / snapGridDistance) + .5)) * snapGridDistance; + double snappedY = Math.Round(yToSnap / snapGridDistance) * snapGridDistance; delta.Y = snappedY - ySnapOffset; } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index b5824a230..a4a900756 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit b5824a2309f04f710250bd75dfb2f5cfada5a7bc +Subproject commit a4a900756db5e0c310c6ff49762aa4414320854c