mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-30 12:10:03 +02:00
[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:
@@ -24,11 +24,6 @@ extern "C" {
|
||||
static MicroPython::ScriptProvider * sScriptProvider = nullptr;
|
||||
static MicroPython::ExecutionEnvironment * sCurrentExecutionEnvironment = nullptr;
|
||||
|
||||
MicroPython::ExecutionEnvironment::ExecutionEnvironment() :
|
||||
m_sandboxIsDisplayed(false)
|
||||
{
|
||||
}
|
||||
|
||||
MicroPython::ExecutionEnvironment * MicroPython::ExecutionEnvironment::currentExecutionEnvironment() {
|
||||
return sCurrentExecutionEnvironment;
|
||||
}
|
||||
@@ -90,6 +85,13 @@ void MicroPython::ExecutionEnvironment::interrupt() {
|
||||
mp_keyboard_interrupt();
|
||||
}
|
||||
|
||||
void MicroPython::ExecutionEnvironment::setSandboxIsDisplayed(bool display) {
|
||||
if (m_sandboxIsDisplayed && !display) {
|
||||
modturtle_view_did_disappear();
|
||||
}
|
||||
m_sandboxIsDisplayed = display;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
extern const void * _stack_start;
|
||||
extern const void * _stack_end;
|
||||
|
||||
Reference in New Issue
Block a user