diff --git a/include/vrv/beam.h b/include/vrv/beam.h index 54683186f3d..6f6b56482c0 100644 --- a/include/vrv/beam.h +++ b/include/vrv/beam.h @@ -295,6 +295,11 @@ class Beam : public LayerElement, std::string GetClassName() const override { return "Beam"; } ///@} + /** + * Overriding CloneReset() method to be called after copy / assignment calls. + */ + void CloneReset() override; + /** * @name Getter to interfaces */ diff --git a/src/beam.cpp b/src/beam.cpp index f3137305ad1..5cc4bbf2c53 100644 --- a/src/beam.cpp +++ b/src/beam.cpp @@ -1619,6 +1619,15 @@ void Beam::Reset() m_stemSameas = NULL; } +void Beam::CloneReset() +{ + // Since these are owned by the beam we cloned from, empty the list + // Do it before Object::CloneReset since that one will reset the coord list + m_beamElementCoords.clear(); + + LayerElement::CloneReset(); +} + bool Beam::IsSupportedChild(Object *child) { if (child->Is(BEAM)) { diff --git a/src/drawinginterface.cpp b/src/drawinginterface.cpp index 7d4b2622981..c843d0431fb 100644 --- a/src/drawinginterface.cpp +++ b/src/drawinginterface.cpp @@ -102,6 +102,8 @@ void BeamDrawingInterface::Reset() m_beamWidth = 0; m_beamWidthBlack = 0; m_beamWidthWhite = 0; + + ClearCoords(); } int BeamDrawingInterface::GetTotalBeamWidth() const