summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorSilc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com>2024-05-09 03:26:42 +0900
committerRémi Verschelde <rverschelde@gmail.com>2024-09-16 17:04:49 +0200
commiteaa8ecb182a774d50e536caabb7bb9d92ce17673 (patch)
treefc0c615779110ed528f820b6a8f6820e46ae42c5 /scene
parentc7dbcbd6d4974acfc1213d48ceede818bbe1131d (diff)
downloadredot-engine-eaa8ecb182a774d50e536caabb7bb9d92ce17673.tar.gz
Fix bone2d scaling
Co-authored-by: Thiago Lages de Alencar <thiagola92@gmail.com> (cherry picked from commit de558123bf557ba563e3dcd537585af08471817f)
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/skeleton_2d.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp
index 1bcac93803..f9e8c831d1 100644
--- a/scene/2d/skeleton_2d.cpp
+++ b/scene/2d/skeleton_2d.cpp
@@ -326,9 +326,7 @@ bool Bone2D::_editor_get_bone_shape(Vector<Vector2> *p_shape, Vector<Vector2> *p
rel = (p_other_bone->get_global_position() - get_global_position());
rel = rel.rotated(-get_global_rotation()); // Undo Bone2D node's rotation so its drawn correctly regardless of the node's rotation
} else {
- real_t angle_to_use = get_rotation() + bone_angle;
- rel = Vector2(cos(angle_to_use), sin(angle_to_use)) * (length * MIN(get_global_scale().x, get_global_scale().y));
- rel = rel.rotated(-get_rotation()); // Undo Bone2D node's rotation so its drawn correctly regardless of the node's rotation
+ rel = Vector2(Math::cos(bone_angle), Math::sin(bone_angle)) * length * get_global_scale();
}
Vector2 relt = rel.rotated(Math_PI * 0.5).normalized() * bone_width;