mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 01:46:01 +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;
|
bool out_of_range = false;
|
||||||
switch (opt->type()) {
|
switch (opt->type()) {
|
||||||
case coFloat:
|
case coFloat:
|
||||||
|
case coPercent:
|
||||||
{
|
{
|
||||||
auto *fopt = static_cast<const ConfigOptionFloat*>(opt);
|
auto *fopt = static_cast<const ConfigOptionFloat*>(opt);
|
||||||
out_of_range = fopt->value < optdef->min || fopt->value > optdef->max;
|
out_of_range = fopt->value < optdef->min || fopt->value > optdef->max;
|
||||||
break;
|
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:
|
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;
|
out_of_range = fopt->get_abs_value(1) < optdef->min || fopt->get_abs_value(1) > optdef->max;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3794,7 +3794,8 @@ void TabPrinter::update_machine_limits_description(const MachineLimitsUsage usag
|
|||||||
break;
|
break;
|
||||||
default: assert(false);
|
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
|
//update fields used
|
||||||
//no need to worry for "silent" version, as it's only for marlin.
|
//no need to worry for "silent" version, as it's only for marlin.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user