Commit ffd3a1b2 authored by Viktor Lidholt's avatar Viktor Lidholt

Fixes issue in sprite constraint

parent e72a66ec
......@@ -53,6 +53,11 @@ class ConstraintRotationToNode extends Constraint {
void constrain(Node node, double dt) {
Offset offset;
if (targetNode.spriteBox != node.spriteBox) {
// The target node is in another sprite box or has been removed
return;
}
if (targetNode.parent == node.parent) {
offset = targetNode.position - node.position;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment