浏览代码

Fix weird editor crash when switching from editing one gradient to another keeps 'grabbing' variable to true

JFonS 7 年之前
父节点
当前提交
f68594a525
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      scene/gui/gradient_edit.cpp

+ 7 - 0
scene/gui/gradient_edit.cpp

@@ -367,6 +367,13 @@ void GradientEdit::_notification(int p_what) {
 			draw_line(Vector2(-1, -1), Vector2(-1, h + 1), Color(1, 1, 1, 0.6));
 		}
 	}
+
+	if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
+
+		if (!is_visible()) {
+			grabbing = false;
+		}
+	}
 }
 
 void GradientEdit::_draw_checker(int x, int y, int w, int h) {