mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Keep pointer to PrintConfig instead of copying it.
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Slic3r {
|
||||
|
||||
Extruder::Extruder(int id, PrintConfig *config)
|
||||
: id(id),
|
||||
config(*config) // make a copy
|
||||
config(config)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
@@ -37,7 +37,7 @@ bool
|
||||
Extruder::use_relative_e_distances() const
|
||||
{
|
||||
// TODO: figure out way to avoid static_cast to access hidden const method
|
||||
const ConfigOption *opt = static_cast<const ConfigBase*>(&this->config)
|
||||
const ConfigOption *opt = static_cast<const ConfigBase*>(this->config)
|
||||
->option("use_relative_e_distances");
|
||||
return *static_cast<const ConfigOptionBool*>(opt);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@ class Extruder
|
||||
double retracted;
|
||||
double restart_extra;
|
||||
|
||||
// TODO: maybe better to keep a reference to an existing object than copy it
|
||||
PrintConfig config;
|
||||
PrintConfig *config;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user