Fix overrides and duplicate binds in PolygonEditor.

This commit is contained in:
Relintai 2022-06-15 17:38:19 +02:00
parent 6e09878f54
commit f1eced523c
3 changed files with 2 additions and 6 deletions

View File

@ -94,11 +94,9 @@ void PolygonEditor::_notification(int p_what) {
void PolygonEditor::_bind_methods() {
ADD_SIGNAL(MethodInfo("value_changed", PropertyInfo(Variant::OBJECT, "value", PROPERTY_HINT_RESOURCE_TYPE, "PolygonBase")));
ClassDB::bind_method(D_METHOD("set_polygon", "p"), &PolygonEditor::set_polygon);
ClassDB::bind_method(D_METHOD("update_controls"), &PolygonEditor::update_controls);
ClassDB::bind_method(D_METHOD("_on_ControlPoint_moved", "index"), &PolygonEditor::_on_ControlPoint_moved);
ClassDB::bind_method(D_METHOD("_on_ControlPoint_removed", "index"), &PolygonEditor::_on_ControlPoint_removed);
ClassDB::bind_method(D_METHOD("_on_PolygonEditor_gui_input", "event"), &PolygonEditor::_on_PolygonEditor_gui_input);
ClassDB::bind_method(D_METHOD("_on_resize"), &PolygonEditor::_on_resize);
}

View File

@ -27,8 +27,6 @@ protected:
void _notification(int p_what);
static void _bind_methods();
Ref<PolygonBase> polygon;
};
#endif

View File

@ -12,7 +12,7 @@ class PolygonView : public Control {
public:
Ref<PolygonBase> get_polygon();
void set_polygon(const Ref<PolygonBase> &val);
virtual void set_polygon(const Ref<PolygonBase> &val);
Vector2 get_draw_size();
void set_draw_size(const Vector2 &val);
@ -27,7 +27,7 @@ public:
Vector2 reverse_transform_point(const Vector2 &p);
void _draw();
void _on_resize();
virtual void _on_resize();
PolygonView();
~PolygonView();