Connect PolygonControlpoint's gui input method.

This commit is contained in:
Relintai 2022-06-15 18:52:55 +02:00
parent 6da06474cf
commit d73d398155
2 changed files with 3 additions and 2 deletions

View File

@ -57,6 +57,9 @@ PolygonControlPoint::~PolygonControlPoint() {
void PolygonControlPoint::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
connect("gui_input", this, "_on_ControlPoint_gui_input");
} break;
case NOTIFICATION_DRAW: {
_draw();
} break;

View File

@ -42,9 +42,7 @@ void PolygonEditor::_on_ControlPoint_moved(const int index) {
PolygonControlPoint *control_point = Object::cast_to<PolygonControlPoint>(get_child(index));
PoolVector2Array points = polygon->get_points();
points.set(index, reverse_transform_point(control_point->get_position() + control_point->OFFSET));
polygon->set_points(points);
update();