Skip to content

Commit

Permalink
Timeline/Graph: selected bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 30, 2024
1 parent 10a4c82 commit 05a9999
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/core/Properties/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,22 @@ bool Property::prp_isParentBoxContained() const
const auto pBox = getFirstAncestor<eBoxOrSound>();
if (pBox && mParentScene) {
const auto contained = mParentScene->getContainedBoxes();
for (const auto &box : contained) { if (box == pBox) { return true; } }
for (const auto &box : contained) {
if (box == pBox) { return true; }
if (prp_isParentBoxContained(box, pBox)) { return true; }
}
}
return false;
}

bool Property::prp_isParentBoxContained(BoundingBox *box,
eBoxOrSound *ebox) const
{
if (box == ebox) { return true; }
if (const auto cbox = enve_cast<ContainerBox*>(box)) {
for (const auto &bbox : cbox->getContainedBoxes()) {
if (prp_isParentBoxContained(bbox, ebox)) { return true; }
}
}
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/Properties/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ class CORE_EXPORT Property : public SingleWidgetTarget {

bool prp_isParentBoxSelected() const;
bool prp_isParentBoxContained() const;
bool prp_isParentBoxContained(BoundingBox *box,
eBoxOrSound *ebox) const;

bool prp_drawsOnCanvas() const
{ return mDrawOnCanvas; }
Expand Down

0 comments on commit 05a9999

Please sign in to comment.