mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-10 21:09:38 +01:00
Connect PolygonControlpoint's gui input method.
This commit is contained in:
parent
6da06474cf
commit
d73d398155
@ -57,6 +57,9 @@ PolygonControlPoint::~PolygonControlPoint() {
|
|||||||
|
|
||||||
void PolygonControlPoint::_notification(int p_what) {
|
void PolygonControlPoint::_notification(int p_what) {
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
|
case NOTIFICATION_POSTINITIALIZE: {
|
||||||
|
connect("gui_input", this, "_on_ControlPoint_gui_input");
|
||||||
|
} break;
|
||||||
case NOTIFICATION_DRAW: {
|
case NOTIFICATION_DRAW: {
|
||||||
_draw();
|
_draw();
|
||||||
} break;
|
} break;
|
||||||
|
@ -42,9 +42,7 @@ void PolygonEditor::_on_ControlPoint_moved(const int index) {
|
|||||||
PolygonControlPoint *control_point = Object::cast_to<PolygonControlPoint>(get_child(index));
|
PolygonControlPoint *control_point = Object::cast_to<PolygonControlPoint>(get_child(index));
|
||||||
|
|
||||||
PoolVector2Array points = polygon->get_points();
|
PoolVector2Array points = polygon->get_points();
|
||||||
|
|
||||||
points.set(index, reverse_transform_point(control_point->get_position() + control_point->OFFSET));
|
points.set(index, reverse_transform_point(control_point->get_position() + control_point->OFFSET));
|
||||||
|
|
||||||
polygon->set_points(points);
|
polygon->set_points(points);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
Loading…
Reference in New Issue
Block a user