[python/turtle] Turtle::m_drawn is false if sandbox not displayed

This way, Turtle::draw() and erase() are more symetrical and no not
perform themselves if the turtle is already drawn / erased.
This commit is contained in:
Léa Saviot
2018-12-17 17:20:25 +01:00
parent ed19d19070
commit 4b306791c0
9 changed files with 49 additions and 23 deletions

View File

@@ -11,6 +11,10 @@ void modturtle_gc_collect() {
gc_collect_root((void **)&sTurtle, sizeof(Turtle));
}
void modturtle_view_did_disappear() {
sTurtle.viewDidDisappear();
}
mp_obj_t modturtle___init__() {
sTurtle = Turtle();
/* Note: we don't even bother writing a destructor for Turtle because this