Merge pull request #89748 from KoBeWi/grabn't

Remove redundant grabbing code from vector editor
This commit is contained in:
Thaddeus Crews 2026-02-17 14:03:55 -06:00
commit 7b089a98d9
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
2 changed files with 1 additions and 15 deletions

View file

@ -91,10 +91,7 @@ void EditorPropertyVectorN::update_property() {
spin_sliders[i]->set_value_no_signal(val.get(i));
}
}
if (!is_grabbed) {
_update_ratio();
}
_update_ratio();
}
void EditorPropertyVectorN::_update_ratio() {
@ -119,13 +116,6 @@ void EditorPropertyVectorN::_store_link(bool p_linked) {
EditorSettings::get_singleton()->set_project_metadata("linked_properties", key, p_linked);
}
void EditorPropertyVectorN::_grab_changed(bool p_grab) {
if (p_grab) {
_update_ratio();
}
is_grabbed = p_grab;
}
void EditorPropertyVectorN::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
@ -229,8 +219,6 @@ EditorPropertyVectorN::EditorPropertyVectorN(Variant::Type p_type, bool p_force_
spin[i]->set_h_size_flags(SIZE_EXPAND_FILL);
}
spin[i]->connect(SceneStringName(value_changed), callable_mp(this, &EditorPropertyVectorN::_value_changed).bind(String(COMPONENT_LABELS[i])));
spin[i]->connect(SNAME("grabbed"), callable_mp(this, &EditorPropertyVectorN::_grab_changed).bind(true));
spin[i]->connect(SNAME("ungrabbed"), callable_mp(this, &EditorPropertyVectorN::_grab_changed).bind(false));
add_focusable(spin[i]);
}

View file

@ -47,13 +47,11 @@ class EditorPropertyVectorN : public EditorProperty {
Vector<EditorSpinSlider *> spin_sliders;
TextureButton *linked = nullptr;
Vector<double> ratio;
bool is_grabbed = false;
bool radians_as_degrees = false;
void _update_ratio();
void _store_link(bool p_linked);
void _grab_changed(bool p_grab);
void _value_changed(double p_val, const String &p_name);
protected: