diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-04-04 22:27:00 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-08-29 10:34:50 -0500 |
commit | ee7bb9bbb9ebf5f4bb6d046340807e2982879428 (patch) | |
tree | d419ed8886352e30e16e3467a0d004de59c20dae /editor | |
parent | 4d08a737fb868b4c2f47946aea7c9ec4ee97894d (diff) |
Display a matrix for Node2D and don't display a duplicate origin
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 8 | ||||
-rw-r--r-- | editor/editor_properties.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index cb7fffe592..d1380e928a 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2268,7 +2268,7 @@ void EditorPropertyTransform2D::setup(double p_min, double p_max, double p_step, } } -EditorPropertyTransform2D::EditorPropertyTransform2D() { +EditorPropertyTransform2D::EditorPropertyTransform2D(bool p_include_origin) { GridContainer *g = memnew(GridContainer); g->set_columns(2); add_child(g); @@ -2278,7 +2278,9 @@ EditorPropertyTransform2D::EditorPropertyTransform2D() { spin[i] = memnew(EditorSpinSlider); spin[i]->set_label(desc[i]); spin[i]->set_flat(true); - g->add_child(spin[i]); + if (p_include_origin || i < 4) { + g->add_child(spin[i]); + } spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); add_focusable(spin[i]); spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyTransform2D::_value_changed), varray(desc[i])); @@ -3285,7 +3287,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ } break; case Variant::TRANSFORM2D: { - EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D); + EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D(p_usage != PROPERTY_USAGE_EDITOR)); EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, default_float_step); editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, hint.suffix); return editor; diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 0cb21bb391..b4b9dc4c46 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -531,7 +531,7 @@ protected: public: virtual void update_property() override; void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); - EditorPropertyTransform2D(); + EditorPropertyTransform2D(bool p_include_origin = true); }; class EditorPropertyBasis : public EditorProperty { |