Skip to content

Commit

Permalink
fix setRetraction
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulLazaro committed Feb 2, 2021
1 parent 348768c commit 50a1eed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/gcodeExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,15 @@ void GCodeExport::writeUnretractionAndPrime()
void GCodeExport::setRetraction(const RetractionConfig& config)
{
ExtruderTrainAttributes& extr_attr = extruder_attr[current_extruder];

extr_attr.retraction_e_amount_current = mmToE(config.distance);

double old_retraction_e_amount = extr_attr.retraction_e_amount_current;
double new_retraction_e_amount = mmToE(config.distance);
double retraction_diff_e_amount = old_retraction_e_amount - new_retraction_e_amount;

current_e_value += retraction_diff_e_amount;

extr_attr.retraction_e_amount_current = new_retraction_e_amount;
extr_attr.prime_volume += config.prime_volume;
}

void GCodeExport::writeRetraction(const RetractionConfig& config, bool force, bool extruder_switch)
Expand Down

0 comments on commit 50a1eed

Please sign in to comment.