Repository navigation
Fix stop-when last-picture display regression - #270
Open
brysenPfingsten wants to merge 1 commit into
Open
brysenPfingsten wants to merge 1 commit into
brysenPfingsten wants to merge 1 commit into
Conversation
Commit f40c4a1 changed close-on-stop's default from #false to #true to avoid blocking the evaluator after big-bang returns. It introduced a regression in the two-argument form of stop-when. When last-picture is provided, wrap-up now takes the else branch, which immediately calls (send the-frame show #f) with no prior yield. The event loop never gets a chance to repaint the canvas, so the window closes and the final scene never appears. The fix I'm suggesting is to tidy up the cond and call (sleep/yield 600) before hiding the frame. This is what was happening in the (close-on-stop #false) case. Example that now works as expected: (big-bang 5 [on-tick sub1 1] [to-draw (lambda (w) (square 500 'solid 'green))] [stop-when zero? (lambda (w) (square 500 'solid 'red))])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit f40c4a1 changed close-on-stop's default from #false to #true to avoid blocking the evaluator after big-bang returns. It introduced a regression in the two-argument form of stop-when. When last-picture is provided, wrap-up now takes the else branch, which immediately calls
(send the-frame show #f)with no prior yield. The event loop never gets a chance to repaint the canvas, so the window closes and the final scene never appears.The fix I'm suggesting is to tidy up the cond and call
(sleep/yield 600)before hiding the frame. This is what was happening in the(close-on-stop #false)case.Example that now works as expected: