mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
ENH: refine the label logic of seq_print
use the arrange_order computed by Print turn on label by default when switch to sequent print Change-Id: I7063bcc9494bbfc14a3cee85eaf30a9eb52c99d2
This commit is contained in:
parent
301b85f5c0
commit
c79af29ad4
2 changed files with 16 additions and 3 deletions
|
@ -248,7 +248,8 @@ void GLCanvas3D::Labels::render(const std::vector<const ModelInstance*>& sorted_
|
|||
return owner.model_instance_id == id;
|
||||
});
|
||||
if (it != owners.end())
|
||||
it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(i + 1);
|
||||
//it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(i + 1);
|
||||
it->print_order = std::string((_(L("Sequence"))).ToUTF8()) + "#: " + std::to_string(sorted_instances[i]->arrange_order);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6037,10 +6038,20 @@ void GLCanvas3D::_render_overlays()
|
|||
bool sequential_print = opt != nullptr && (opt->value == PrintSequence::ByObject);
|
||||
std::vector<const ModelInstance*> sorted_instances;
|
||||
if (sequential_print) {
|
||||
for (ModelObject* model_object : m_model->objects)
|
||||
const Print* print = fff_print();
|
||||
if (print) {
|
||||
for (const PrintObject *print_object : print->objects())
|
||||
{
|
||||
for (const PrintInstance &instance : print_object->instances())
|
||||
{
|
||||
sorted_instances.emplace_back(instance.model_instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*for (ModelObject* model_object : m_model->objects)
|
||||
for (ModelInstance* model_instance : model_object->instances) {
|
||||
sorted_instances.emplace_back(model_instance);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
m_labels.render(sorted_instances);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue