mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 23:09:00 +08:00
Add to GCodeGenerator::last_position only when it has an assigned value.
This behavior was there for a long time, but it was uncovered when std::optional was used.
This commit is contained in:
parent
da57489874
commit
5ddcea806b
@ -2641,7 +2641,9 @@ void GCodeGenerator::set_origin(const Vec2d &pointf)
|
||||
{
|
||||
// if origin increases (goes towards right), last_pos decreases because it goes towards left
|
||||
const auto offset = Point::new_scale(m_origin - pointf);
|
||||
*(this->last_position) += offset;
|
||||
if (last_position.has_value())
|
||||
*(this->last_position) += offset;
|
||||
|
||||
m_wipe.offset_path(offset);
|
||||
m_origin = pointf;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user