Browse Source

Make sure inbetween lines in inspector can't be clicked, fixes #19014

Juan Linietsky 7 years ago
parent
commit
dc33d25fec
1 changed files with 5 additions and 0 deletions
  1. 5 0
      editor/editor_inspector.cpp

+ 5 - 0
editor/editor_inspector.cpp

@@ -1153,6 +1153,11 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
 	Ref<InputEventMouseButton> mb = p_event;
 	Ref<InputEventMouseButton> mb = p_event;
 	if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
 	if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
 
 
+		Ref<Font> font = get_font("font", "Tree");
+		if (mb->get_position().y > font->get_height()) { //clicked outside
+			return;
+		}
+
 		_test_unfold();
 		_test_unfold();
 
 
 		bool unfold = !object->editor_is_section_unfolded(section);
 		bool unfold = !object->editor_is_section_unfolded(section);