Kaynağa Gözat

Merge pull request #107103 from timothyqiu/handle-handling

Fix WorldBoundaryShape2D handle when distance is negative
Thaddeus Crews 2 ay önce
ebeveyn
işleme
978b38797b

+ 2 - 1
editor/plugins/collision_shape_2d_editor_plugin.cpp

@@ -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;