From c6c5b5bf78ad62fc27b0eadabd355fe359f2b2b1 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:49:24 +0200 Subject: [PATCH] Fix Animation::subtract_variant for affine transforms (cherry picked from commit 87935ca8376c37e4074400ba7e2345e1a3aa3d37) --- scene/resources/animation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 7c0db810be7..860e48a3618 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5565,10 +5565,10 @@ Variant Animation::subtract_variant(const Variant &a, const Variant &b) { return (b.operator Quaternion()).inverse() * (a.operator Quaternion()); } case Variant::TRANSFORM2D: { - return (b.operator Transform2D()).inverse() * (a.operator Transform2D()); + return (b.operator Transform2D()).affine_inverse() * (a.operator Transform2D()); } case Variant::TRANSFORM3D: { - return (b.operator Transform3D()).inverse() * (a.operator Transform3D()); + return (b.operator Transform3D()).affine_inverse() * (a.operator Transform3D()); } default: { return Variant::evaluate(Variant::OP_SUBTRACT, a, b);