mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 16:55:53 +08:00
Fix crash when pressing 'A' without any objects on plater
This commit is contained in:
parent
ba8b81b27e
commit
f7c832ddaf
@ -165,8 +165,6 @@ void ArrangeJob::process(Ctl &ctl)
|
|||||||
{
|
{
|
||||||
static const auto arrangestr = _u8L("Arranging");
|
static const auto arrangestr = _u8L("Arranging");
|
||||||
|
|
||||||
ctl.update_status(0, arrangestr);
|
|
||||||
|
|
||||||
arrangement::ArrangeParams params;
|
arrangement::ArrangeParams params;
|
||||||
Points bedpts;
|
Points bedpts;
|
||||||
ctl.call_on_main_thread([this, ¶ms, &bedpts]{
|
ctl.call_on_main_thread([this, ¶ms, &bedpts]{
|
||||||
@ -175,7 +173,12 @@ void ArrangeJob::process(Ctl &ctl)
|
|||||||
bedpts = get_bed_shape(*m_plater->config());
|
bedpts = get_bed_shape(*m_plater->config());
|
||||||
}).wait();
|
}).wait();
|
||||||
|
|
||||||
auto count = unsigned(m_selected.size() + m_unprintable.size());
|
auto count = unsigned(m_selected.size() + m_unprintable.size());
|
||||||
|
|
||||||
|
if (count == 0) // Should be taken care of by plater, but doesn't hurt
|
||||||
|
return;
|
||||||
|
|
||||||
|
ctl.update_status(0, arrangestr);
|
||||||
|
|
||||||
params.stopcondition = [&ctl]() { return ctl.was_canceled(); };
|
params.stopcondition = [&ctl]() { return ctl.was_canceled(); };
|
||||||
|
|
||||||
|
@ -4977,7 +4977,7 @@ bool Plater::priv::can_split_to_volumes() const
|
|||||||
|
|
||||||
bool Plater::priv::can_arrange() const
|
bool Plater::priv::can_arrange() const
|
||||||
{
|
{
|
||||||
if (model.objects.empty() && m_worker.is_idle()) return false;
|
if (model.objects.empty() || !m_worker.is_idle()) return false;
|
||||||
if (q->canvas3D()->get_gizmos_manager().get_current_type() == GLGizmosManager::Emboss) return false;
|
if (q->canvas3D()->get_gizmos_manager().get_current_type() == GLGizmosManager::Emboss) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -6821,8 +6821,8 @@ GLCanvas3D* Plater::get_current_canvas3D()
|
|||||||
|
|
||||||
void Plater::arrange()
|
void Plater::arrange()
|
||||||
{
|
{
|
||||||
auto &w = get_ui_job_worker();
|
if (p->can_arrange()) {
|
||||||
if (w.is_idle()) {
|
auto &w = get_ui_job_worker();
|
||||||
p->take_snapshot(_L("Arrange"));
|
p->take_snapshot(_L("Arrange"));
|
||||||
replace_job(w, std::make_unique<ArrangeJob>());
|
replace_job(w, std::make_unique<ArrangeJob>());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user