1
0
Fork 0

Merge pull request #107103 from timothyqiu/handle-handling

Fix WorldBoundaryShape2D handle when distance is negative
This commit is contained in:
Thaddeus Crews 2025-06-04 10:34:39 -05:00
commit 978b38797b
No known key found for this signature in database
GPG Key ID: 8C6E5FEB5FC03CCC
1 changed files with 2 additions and 1 deletions

View File

@ -184,7 +184,8 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) {
Vector2 normal = world_boundary->get_normal();
world_boundary->set_distance(p_point.dot(normal) / normal.length_squared());
} else {
world_boundary->set_normal(p_point.normalized());
real_t dir = world_boundary->get_distance() < 0 ? -1 : 1;
world_boundary->set_normal(p_point.normalized() * dir);
}
}
} break;