diff options
Diffstat (limited to 'UVtools.Core/GCode/GCodeBuilder.cs')
-rw-r--r-- | UVtools.Core/GCode/GCodeBuilder.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/UVtools.Core/GCode/GCodeBuilder.cs b/UVtools.Core/GCode/GCodeBuilder.cs index 6081be0..4ee83cc 100644 --- a/UVtools.Core/GCode/GCodeBuilder.cs +++ b/UVtools.Core/GCode/GCodeBuilder.cs @@ -673,15 +673,15 @@ namespace UVtools.Core.GCode { AppendLiftMoveGx(lifts, retracts, waitAfterLift, 0, layer); } - else if (lastZPosition < layer.PositionZ) // Ensure Z is on correct position + else if (lastZPosition != layer.PositionZ) // Ensure Z is on correct position { switch (GCodePositioningType) { case GCodePositioningTypes.Absolute: - AppendMoveGx(layer.PositionZ, liftSpeed); + AppendMoveGx(layer.PositionZ, lastZPosition < layer.PositionZ ? Math.Max(liftSpeed, liftSpeed2) : Math.Max(retractSpeed, retractSpeed2)); break; case GCodePositioningTypes.Partial: - AppendMoveGx(Layer.RoundHeight(layer.PositionZ - lastZPosition), liftSpeed); + AppendMoveGx(Layer.RoundHeight(layer.PositionZ - lastZPosition), lastZPosition < layer.PositionZ ? Math.Max(liftSpeed, liftSpeed2) : Math.Max(retractSpeed, retractSpeed2)); break; } |