Skip to content

Commit

Permalink
add missing dirty flags
Browse files Browse the repository at this point in the history
some properties were not marking constraints as dirty and the render wouldn't update.
I did a pass to all constraints so find out which one were missing and these are the ones I found

Diffs=
348017707 add missing dirty flags (#8276)

Co-authored-by: hernan <hernan@rive.app>
  • Loading branch information
bodymovin and bodymovin committed Oct 3, 2024
1 parent 74a5994 commit b3976e8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0ee01f78447b6cecc53d2462b547075d651d0b0f
3480177078433e41d88b41be7e52d43824634329
1 change: 1 addition & 0 deletions include/rive/constraints/ik_constraint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class IKConstraint : public IKConstraintBase
StatusCode onAddedClean(CoreContext* context) override;
void constrain(TransformComponent* component) override;
void buildDependencies() override;
void invertDirectionChanged() override;
};
} // namespace rive

Expand Down
2 changes: 2 additions & 0 deletions include/rive/constraints/transform_constraint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class TransformConstraint : public TransformConstraintBase
public:
virtual const Mat2D targetTransform() const;
void constrain(TransformComponent* component) override;
void originXChanged() override;
void originYChanged() override;
};
} // namespace rive

Expand Down
2 changes: 2 additions & 0 deletions src/constraints/ik_constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ void IKConstraint::solve2(BoneChainLink* fk1,
firstChild->angle = r2;
}

void IKConstraint::invertDirectionChanged() { markConstraintDirty(); }

void IKConstraint::constrainRotation(BoneChainLink& fk, float rotation)
{
Bone* bone = fk.bone;
Expand Down
4 changes: 4 additions & 0 deletions src/constraints/transform_constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const Mat2D TransformConstraint::targetTransform() const
return m_Target->worldTransform() * local;
}

void TransformConstraint::originXChanged() { markConstraintDirty(); }

void TransformConstraint::originYChanged() { markConstraintDirty(); }

void TransformConstraint::constrain(TransformComponent* component)
{
if (m_Target == nullptr || m_Target->isCollapsed())
Expand Down

0 comments on commit b3976e8

Please sign in to comment.