Skip to content

Commit

Permalink
propagate volume to nested artboards
Browse files Browse the repository at this point in the history
propagate volume to nested artboards

Diffs=
2828b7b01 propagate volume to nested artboards (#7067)

Co-authored-by: hernan <hernan@rive.app>
  • Loading branch information
bodymovin and bodymovin committed Apr 17, 2024
1 parent ae49ac7 commit f8e8401
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4a9947630d3848ff70813cf5e2d8718adb9a1b90
2828b7b013811f1f4b0b0e2ee0f6d9b23c73878b
13 changes: 12 additions & 1 deletion src/artboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,18 @@ StatusCode Artboard::import(ImportStack& importStack)
}

float Artboard::volume() const { return m_volume; }
void Artboard::volume(float value) { m_volume = value; }
void Artboard::volume(float value)
{
m_volume = value;
for (auto nestedArtboard : m_NestedArtboards)
{
auto artboard = nestedArtboard->artboard();
if (artboard != nullptr)
{
artboard->volume(value);
}
}
}

////////// ArtboardInstance

Expand Down
1 change: 1 addition & 0 deletions src/nested_artboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void NestedArtboard::nest(Artboard* artboard)
}
m_Artboard->frameOrigin(false);
m_Artboard->opacity(renderOpacity());
m_Artboard->volume(artboard->volume());
m_Instance = nullptr;
if (artboard->isInstance())
{
Expand Down

0 comments on commit f8e8401

Please sign in to comment.