mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01: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:
@@ -3,10 +3,12 @@
|
||||
|
||||
namespace Code {
|
||||
|
||||
SandboxController::SandboxController(Responder * parentResponder) :
|
||||
SandboxController::SandboxController(Responder * parentResponder, MicroPython::ExecutionEnvironment * executionEnvironment) :
|
||||
ViewController(parentResponder),
|
||||
m_solidColorView(KDColorWhite)
|
||||
m_solidColorView(KDColorWhite),
|
||||
m_executionEnvironment(executionEnvironment)
|
||||
{
|
||||
assert(executionEnvironment != nullptr);
|
||||
}
|
||||
|
||||
StackViewController * SandboxController::stackViewController() {
|
||||
@@ -19,9 +21,16 @@ void SandboxController::reset() {
|
||||
}
|
||||
|
||||
void SandboxController::viewWillAppear() {
|
||||
assert(m_executionEnvironment != nullptr);
|
||||
m_executionEnvironment->setSandboxIsDisplayed(true);
|
||||
redrawWindow();
|
||||
}
|
||||
|
||||
void SandboxController::viewDidDisappear() {
|
||||
assert(m_executionEnvironment != nullptr);
|
||||
m_executionEnvironment->setSandboxIsDisplayed(false);
|
||||
}
|
||||
|
||||
bool SandboxController::handleEvent(Ion::Events::Event event) {
|
||||
// The sandbox handles or "absorbs" all keyboard events except Home and OnOff
|
||||
if (event == Ion::Events::Home || event == Ion::Events::OnOff) {
|
||||
|
||||
Reference in New Issue
Block a user