Fixing a regression crash in Preset Hints.

This commit is contained in:
Vojtech Bubnik 2021-06-02 11:28:55 +02:00
parent 0bfc53f5a5
commit a1283277d3

View file

@ -210,6 +210,11 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
return out;
}
if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10);
out += (boost::format(_utf8(L("Recommended object thin wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
// Start with the width of two closely spaced
try {
Flow external_perimeter_flow = Flow::new_from_config_width(
frExternalPerimeter,
*print_config.opt<ConfigOptionFloatOrPercent>("external_perimeter_extrusion_width"),
@ -218,13 +223,6 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
frPerimeter,
*print_config.opt<ConfigOptionFloatOrPercent>("perimeter_extrusion_width"),
nozzle_diameter, layer_height);
if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10);
out += (boost::format(_utf8(L("Recommended object thin wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
// Start with the width of two closely spaced
try {
double width = external_perimeter_flow.width() + external_perimeter_flow.spacing();
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {
if (i > 2)