From a5a7b9e821869ec6c4b7c81b4ea4a69aadef6317 Mon Sep 17 00:00:00 2001 From: bodymovin Date: Tue, 28 Jan 2025 17:07:01 +0000 Subject: [PATCH] change inherit blend mode default value to 127 when -1 was serialized, it was being converted to 127 and would break the editor blend mode mapping. so this PR changes the default value to 127. Fortunately, older files that didn't change the blend mode explicitly wouldn't have any value, so this will still be the default. And files that did change the blend value to something different than inherit, and changed it back to inherit, will have 127 as value that will match the new inherit assigned value. So this covers older files and newer files with old runtimes and new runtimes. Diffs= bf57f85d7f change inherit blend mode default value to 127 (#8926) Co-authored-by: hernan --- .rive_head | 2 +- dev/defs/shapes/paint/shape_paint.json | 4 ++-- include/rive/generated/shapes/paint/shape_paint_base.hpp | 2 +- src/shapes/paint/shape_paint.cpp | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.rive_head b/.rive_head index 7f9952a1..ce9df152 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -fcda031783b4d7e5bf2d983081cfe76ff60b1f57 +bf57f85d7fb6e30a2070ae4f104b8ec49e99c2fe diff --git a/dev/defs/shapes/paint/shape_paint.json b/dev/defs/shapes/paint/shape_paint.json index 5514506b..c40203b9 100644 --- a/dev/defs/shapes/paint/shape_paint.json +++ b/dev/defs/shapes/paint/shape_paint.json @@ -27,12 +27,12 @@ }, "blendModeValue": { "type": "uint", - "initialValue": "-1", + "initialValue": "127", "key": { "int": 747, "string": "blendmodevalue" }, - "description": "Shape paint blend mode value. -1 means inherit." + "description": "Shape paint blend mode value. 127 means inherit." } } } \ No newline at end of file diff --git a/include/rive/generated/shapes/paint/shape_paint_base.hpp b/include/rive/generated/shapes/paint/shape_paint_base.hpp index 9b12df07..25796ba0 100644 --- a/include/rive/generated/shapes/paint/shape_paint_base.hpp +++ b/include/rive/generated/shapes/paint/shape_paint_base.hpp @@ -35,7 +35,7 @@ class ShapePaintBase : public ContainerComponent protected: bool m_IsVisible = true; - uint32_t m_BlendModeValue = -1; + uint32_t m_BlendModeValue = 127; public: virtual bool isVisible() const { return m_IsVisible; } diff --git a/src/shapes/paint/shape_paint.cpp b/src/shapes/paint/shape_paint.cpp index 0ad220de..d4a6c307 100644 --- a/src/shapes/paint/shape_paint.cpp +++ b/src/shapes/paint/shape_paint.cpp @@ -38,7 +38,8 @@ RenderPaint* ShapePaint::initRenderPaint(ShapePaintMutator* mutator) void ShapePaint::blendMode(BlendMode parentValue) { assert(m_RenderPaint != nullptr); - if (blendModeValue() == -1) + // 127 means inherit + if (blendModeValue() == 127) { m_RenderPaint->blendMode(parentValue); }