Skip to content

Commit 978b387

Browse files
committed
Merge pull request #107103 from timothyqiu/handle-handling
Fix WorldBoundaryShape2D handle when distance is negative
2 parents 34c6da4 + 73002a6 commit 978b387

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/plugins/collision_shape_2d_editor_plugin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) {
184184
Vector2 normal = world_boundary->get_normal();
185185
world_boundary->set_distance(p_point.dot(normal) / normal.length_squared());
186186
} else {
187-
world_boundary->set_normal(p_point.normalized());
187+
real_t dir = world_boundary->get_distance() < 0 ? -1 : 1;
188+
world_boundary->set_normal(p_point.normalized() * dir);
188189
}
189190
}
190191
} break;

0 commit comments

Comments
 (0)