Skip to content

Commit

Permalink
Fix bone2d scaling
Browse files Browse the repository at this point in the history
Co-authored-by: Thiago Lages de Alencar <[email protected]>
  • Loading branch information
TokageItLab and thiagola92 committed May 9, 2024
1 parent 965bae7 commit de55812
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scene/2d/skeleton_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,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;
Expand Down

0 comments on commit de55812

Please sign in to comment.