diff --git a/MatterControl.Printing/GCode/GCodeFile.cs b/MatterControl.Printing/GCode/GCodeFile.cs index 153ea6654..912e64158 100644 --- a/MatterControl.Printing/GCode/GCodeFile.cs +++ b/MatterControl.Printing/GCode/GCodeFile.cs @@ -224,11 +224,17 @@ namespace MatterControl.Printing Vector4 velocitySameAsStopMmPerS, Vector4 speedMultiplierV4) { - double startingVelocityMmPerS = velocitySameAsStopMmPerS.X; - double endingVelocityMmPerS = velocitySameAsStopMmPerS.X; - double maxVelocityMmPerSx = Math.Min(feedRateMmPerMin / 60, maxVelocityMmPerS.X); - double acceleration = maxAccelerationMmPerS2.X; double lengthOfThisMoveMm = Math.Max(deltaPositionThisLine.Length, deltaEPositionThisLine); + + if (lengthOfThisMoveMm == 0) + { + return 0; + } + + double maxVelocityMmPerSx = Math.Min(feedRateMmPerMin / 60, maxVelocityMmPerS.X); + double startingVelocityMmPerS = Math.Min(velocitySameAsStopMmPerS.X, maxVelocityMmPerSx); + double endingVelocityMmPerS = startingVelocityMmPerS; + double acceleration = maxAccelerationMmPerS2.X; double speedMultiplier = speedMultiplierV4.X; double distanceToMaxVelocity = GetDistanceToReachEndingVelocity(startingVelocityMmPerS, maxVelocityMmPerSx, acceleration); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index f0ae8affb..2932cc92a 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit f0ae8affbd243e7969eca8078db7a17daa19a1a6 +Subproject commit 2932cc92a8d67fcfe5bbff3c762b1c43ec700ede