Fix PA pattern crash if default/first layer line width is percentage (#7592)

Fix PA pattern crash if default/first layer line width is percentage (SoftFever/OrcaSlicer#7569)
This commit is contained in:
Noisyfox 2024-11-27 20:25:57 +08:00 committed by GitHub
parent ca35ba4107
commit 3666f84e65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -266,8 +266,18 @@ public:
protected:
double speed_first_layer() const { return m_config.option<ConfigOptionFloat>("initial_layer_speed")->value; };
double speed_perimeter() const { return m_config.option<ConfigOptionFloat>("outer_wall_speed")->value; };
double line_width_first_layer() const { return m_config.get_abs_value("initial_layer_line_width"); };
double line_width() const { return m_config.get_abs_value("line_width"); };
double line_width_first_layer() const
{
// TODO: FIXME: find out current filament/extruder?
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", 0);
return m_config.get_abs_value("initial_layer_line_width", nozzle_diameter);
};
double line_width() const
{
// TODO: FIXME: find out current filament/extruder?
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", 0);
return m_config.get_abs_value("line_width", nozzle_diameter);
};
int wall_count() const { return m_config.option<ConfigOptionInt>("wall_loops")->value; };
private: