Fix for nested artboard source opacity.
Fix for issue caught by @JcToon and @zplata here: https://2dimensions.slack.com/archives/CHMAP278R/p1655715374999519
It's important for us to not modify the source artboard's properties. We use "nest" in two places:
- When first loading the file to mark which artboard is the linked one to a NestedArtboard node (important to not change it here, which this code handles).
- When instancing as the actual artboard to manipulate and draw from for this instance.
Diffs=
b6f703859 Fix for nested artboard source opacity.
diff --git a/.rive_head b/.rive_head
index d271d13..8cee0f0 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-300e4dc14bafeebdb7c378e28b2098688891f14e
+b6f703859cbdd996fa550d317acc4a3af21611d7
diff --git a/src/nested_artboard.cpp b/src/nested_artboard.cpp
index 0855bad..18ae876 100644
--- a/src/nested_artboard.cpp
+++ b/src/nested_artboard.cpp
@@ -26,6 +26,11 @@
assert(artboard != nullptr);
m_Artboard = artboard;
+ if (!m_Artboard->isInstance()) {
+ // We're just marking the source artboard so we can later instance from
+ // it. No need to advance it or change any of its properties.
+ return;
+ }
m_Artboard->frameOrigin(false);
m_Artboard->opacity(renderOpacity());
m_Instance = nullptr;