-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add artboards shapes to updates when RenderOpacity has dirt
Fixes nested artboards not applying inherited opacity to their backgrounds Issue #5887 Diffs= 0dcbdade4 add artboards shapes to updates when RenderOpacity has dirt (#5971) Co-authored-by: hernan <hernantorrisi@gmail.com>
- Loading branch information
Showing
5 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
85b2b6ed1965d66f5f268993e54f5f89f30a2e29 | ||
0dcbdade49885fcae4de304972ae37f6283f19d1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include <rive/file.hpp> | ||
#include <rive/node.hpp> | ||
#include <rive/nested_artboard.hpp> | ||
#include <rive/shapes/paint/shape_paint.hpp> | ||
#include "rive_file_reader.hpp" | ||
|
||
TEST_CASE("Nested artboard background renders with opacity", "[file]") | ||
{ | ||
auto file = ReadRiveFile("../../test/assets/nested_artboard_opacity.riv"); | ||
|
||
auto mainArtboard = file->artboard()->instance(); | ||
REQUIRE(mainArtboard->find("Parent Artboard") != nullptr); | ||
auto artboard = mainArtboard->find<rive::Artboard>("Parent Artboard"); | ||
artboard->updateComponents(); | ||
REQUIRE(artboard->is<rive::Artboard>()); | ||
REQUIRE(artboard->find("Nested artboard container") != nullptr); | ||
auto nestedArtboardContainer = artboard->find<rive::NestedArtboard>("Nested artboard container"); | ||
REQUIRE(nestedArtboardContainer->artboard() != nullptr); | ||
auto nestedArtboard = nestedArtboardContainer->artboard(); | ||
nestedArtboard->updateComponents(); | ||
auto paints = nestedArtboard->shapePaints(); | ||
REQUIRE(paints.size() == 1); | ||
auto paint = paints[0]; | ||
REQUIRE(paint->is<rive::ShapePaint>()); | ||
REQUIRE(paint->renderOpacity() == 0.3275f); | ||
} |