Skip to content

Commit

Permalink
Reset cloned beams coord list
Browse files Browse the repository at this point in the history
* Fixes #3702
* Test-suite evaluated locally
  • Loading branch information
lpugin committed Jul 18, 2024
1 parent 89715f3 commit 9dcff60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/vrv/beam.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
9 changes: 9 additions & 0 deletions src/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 2 additions & 0 deletions src/drawinginterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void BeamDrawingInterface::Reset()
m_beamWidth = 0;
m_beamWidthBlack = 0;
m_beamWidthWhite = 0;

ClearCoords();
}

int BeamDrawingInterface::GetTotalBeamWidth() const
Expand Down

0 comments on commit 9dcff60

Please sign in to comment.