Ver código fonte

Fix warnings about invalid logical not on left hand side [-Wlogical-not-parentheses]

Fixes the following Clang 7 warnings and bugs:
```
editor/plugins/curve_editor_plugin.cpp:208:69: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
editor/plugins/curve_editor_plugin.cpp:214:43: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
```

Changed according to @Zylann's suggestion on
https://github.com/godotengine/godot/pull/22593#discussion_r221699573
Rémi Verschelde 7 anos atrás
pai
commit
b2bba4be44
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      editor/plugins/curve_editor_plugin.cpp

+ 2 - 2
editor/plugins/curve_editor_plugin.cpp

@@ -205,13 +205,13 @@ void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
 						curve.set_point_left_tangent(_selected_point, tangent);
 
 						// Note: if a tangent is set to linear, it shouldn't be linked to the other
-						if (link && _selected_point != curve.get_point_count() - 1 && !curve.get_point_right_mode(_selected_point) != Curve::TANGENT_FREE)
+						if (link && _selected_point != (curve.get_point_count() - 1) && curve.get_point_right_mode(_selected_point) != Curve::TANGENT_LINEAR)
 							curve.set_point_right_tangent(_selected_point, tangent);
 
 					} else {
 						curve.set_point_right_tangent(_selected_point, tangent);
 
-						if (link && _selected_point != 0 && !curve.get_point_left_mode(_selected_point) != Curve::TANGENT_FREE)
+						if (link && _selected_point != 0 && curve.get_point_left_mode(_selected_point) != Curve::TANGENT_LINEAR)
 							curve.set_point_left_tangent(_selected_point, tangent);
 					}
 				}