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

(cherry picked from commit f68594a525)
This commit is contained in:
JFonS 2018-02-12 22:22:45 +01:00 committed by Hein-Pieter van Braam
parent cf2e30b30c
commit a026e2626c
1 changed files with 7 additions and 0 deletions

View File

@ -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)); 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) { void GradientEdit::_draw_checker(int x, int y, int w, int h) {