Browse Source

Merge pull request #12159 from RandomShaper/fix-sticky-slider

Reset slider mouse state on hiding/removing
Gilles Roudiere 8 years ago
parent
commit
5e348e72c1
1 changed files with 6 additions and 0 deletions
  1. 6 0
      scene/gui/slider.cpp

+ 6 - 0
scene/gui/slider.cpp

@@ -157,6 +157,12 @@ void Slider::_notification(int p_what) {
 			mouse_inside = false;
 			update();
 		} break;
+		case NOTIFICATION_VISIBILITY_CHANGED: // fallthrough
+		case NOTIFICATION_EXIT_TREE: {
+
+			mouse_inside = false;
+			grab.active = false;
+		} break;
 		case NOTIFICATION_DRAW: {
 			RID ci = get_canvas_item();
 			Size2i size = get_size();