From c9350e5a712f3c59c3666c8291634805365815a4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 31 Jul 2021 12:16:56 +0200 Subject: [PATCH] hackish attempt to get rid of the gray rectangle render error --- .gitignore | 1 + stitchcode/CHANGELOG.txt | 9 +++++++-- stitchcode/objects.js | 14 +++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index cfe1a910..b821f693 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store *.swp .tern-port +*.sh diff --git a/stitchcode/CHANGELOG.txt b/stitchcode/CHANGELOG.txt index ba3e2c28..72fedbd3 100644 --- a/stitchcode/CHANGELOG.txt +++ b/stitchcode/CHANGELOG.txt @@ -1,8 +1,13 @@ -* 2021-08-13 (snap6 branch/ 2.7 dev) + +* 2021-07-30 (snap6 branch/ 2.7 dev) + - include turtle model definition and simplex font as javascript + instead of loading from url as json (also works offline now!) + +* 2021-07-13 (snap6 branch/ 2.7 dev) - fix app mode? -* 2021-08-12 (snap6 branch/ 2.7 dev) +* 2021-07-12 (snap6 branch/ 2.7 dev) - revert back to three r97 (too many small bugs no big pros? (issue #93) - make fullscreen/appmode usable again diff --git a/stitchcode/objects.js b/stitchcode/objects.js index e14b9072..2b49bb8c 100644 --- a/stitchcode/objects.js +++ b/stitchcode/objects.js @@ -714,6 +714,11 @@ SpriteMorph.prototype.doMoveForward = function (steps) { if (dist != 0) { this.setPosition(dest); + // this is a quick hack but delaying the rerender seems to get rid of the + // grey square that shows as a rendering error (still don't know where it + // comes from ) + // setTimeout(() => stage.reRender(), 10) + var isFirst = this.parentThatIsA(StageMorph).turtleShepherd.isEmpty(); warn = stage.turtleShepherd.moveTo( oldx, oldy, @@ -2630,8 +2635,13 @@ StageMorph.prototype.renderCycle = function () { this.changed(); this.parentThatIsA(IDE_Morph).statusDisplay.refresh(); this.renderer.changed = false; + + // this is a hack but it seems to be need for a clear render! + setTimeout(()=> this.changed(), 5) } -}; + // this.render(); + // this.changed(); +} StageMorph.prototype.reRender = function () { this.renderer.changed = true; @@ -2814,8 +2824,6 @@ StageMorph.prototype.step = function () { this.renderCycle(); } }; - - this.stepcounter++; };