mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 08:36:00 +08:00
some fix for coPercent cast & m_machine_limits_description_line null check
This commit is contained in:
parent
996a42f2f9
commit
2f1a754f70
@ -5664,20 +5664,15 @@ std::string FullPrintConfig::validate()
|
||||
bool out_of_range = false;
|
||||
switch (opt->type()) {
|
||||
case coFloat:
|
||||
case coPercent:
|
||||
{
|
||||
auto *fopt = static_cast<const ConfigOptionFloat*>(opt);
|
||||
out_of_range = fopt->value < optdef->min || fopt->value > optdef->max;
|
||||
break;
|
||||
}
|
||||
case coPercent:
|
||||
{
|
||||
auto* fopt = static_cast<const ConfigOptionPercent*>(opt);
|
||||
out_of_range = fopt->get_abs_value(100) < optdef->min || fopt->get_abs_value(100) > optdef->max;
|
||||
break;
|
||||
}
|
||||
case coFloatOrPercent:
|
||||
{
|
||||
auto *fopt = static_cast<const ConfigOptionPercent*>(opt);
|
||||
auto *fopt = static_cast<const ConfigOptionFloatOrPercent*>(opt);
|
||||
out_of_range = fopt->get_abs_value(1) < optdef->min || fopt->get_abs_value(1) > optdef->max;
|
||||
break;
|
||||
}
|
||||
|
@ -3794,7 +3794,8 @@ void TabPrinter::update_machine_limits_description(const MachineLimitsUsage usag
|
||||
break;
|
||||
default: assert(false);
|
||||
}
|
||||
m_machine_limits_description_line->SetText(text);
|
||||
if(m_machine_limits_description_line)
|
||||
m_machine_limits_description_line->SetText(text);
|
||||
|
||||
//update fields used
|
||||
//no need to worry for "silent" version, as it's only for marlin.
|
||||
|
Loading…
x
Reference in New Issue
Block a user