Fixed a bug that print_bed_min/max values were not correct in multi-plate project #1834

This commit is contained in:
SoftFever 2023-08-19 11:01:00 +08:00
parent 94f8c26c30
commit 5f848b7a93

View file

@ -1795,11 +1795,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
is_extruder_used[extruder] = true;
m_placeholder_parser.set("is_extruder_used", new ConfigOptionBools(is_extruder_used));
Vec2f plate_offset = m_writer.get_xy_offset();
{
BoundingBoxf bbox(print.config().printable_area.values);
m_placeholder_parser.set("print_bed_min", new ConfigOptionFloats({ bbox.min.x() - plate_offset.x(), bbox.min.y() - plate_offset.y() }));
m_placeholder_parser.set("print_bed_max", new ConfigOptionFloats({ bbox.max.x() - plate_offset.x(), bbox.max.y() - plate_offset.y() }));
m_placeholder_parser.set("print_bed_min", new ConfigOptionFloats({ bbox.min.x(), bbox.min.y()}));
m_placeholder_parser.set("print_bed_max", new ConfigOptionFloats({ bbox.max.x(), bbox.max.y()}));
m_placeholder_parser.set("print_bed_size", new ConfigOptionFloats({ bbox.size().x(), bbox.size().y() }));
}
{