Title: canvas.visible = False freezes the last frame instead of hiding the canvas · Issue #231 · vpython/glowscript · GitHub
Open Graph Title: canvas.visible = False freezes the last frame instead of hiding the canvas · Issue #231 · vpython/glowscript
X Title: canvas.visible = False freezes the last frame instead of hiding the canvas · Issue #231 · vpython/glowscript
Description: The docs say that with canvas.visible = False, "no objects are displayed in this canvas." Instead, the canvas freezes on its last frame. This was reported on the glowscript-users list on 2026-11-12. Web VPython 3.2 b = canvas(background=...
Open Graph Description: The docs say that with canvas.visible = False, "no objects are displayed in this canvas." Instead, the canvas freezes on its last frame. This was reported on the glowscript-users list on 2026-11-12...
X Description: The docs say that with canvas.visible = False, "no objects are displayed in this canvas." Instead, the canvas freezes on its last frame. This was reported on the glowscript-users list on ...
Opengraph URL: https://github.com/vpython/glowscript/issues/231
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"canvas.visible = False freezes the last frame instead of hiding the canvas","articleBody":"The docs say that with `canvas.visible = False`, \"no objects are displayed in this canvas.\" Instead, the canvas freezes on its last frame. This was reported on the glowscript-users list on 2026-11-12.\n\n```python\nWeb VPython 3.2\nb = canvas(background=color.white, range=2)\nc = box(color=color.green)\nrate(1)\nb.visible = False\nd = box(pos=vec(.5,1,0), color=color.blue)\nrate(.5)\nb.visible = True\nrate(1)\nb.visible = False\n```\n\nWhat the user sees:\n\n| | Expected | Actual |\n|---|---|---|\n| After `b.visible = False` | The canvas shows nothing | The green box stays; the scene can't be rotated |\n| After the blue box is created | Nothing appears | Nothing appears |\n| After `b.visible = True` | Both boxes | Both boxes, and rotation works again |\n| After the second `False` | The canvas shows nothing | Both boxes stay, frozen |\n\n## Cause\n\n`canvas.visible` is a plain attribute (`lib/glow/canvas.js:215`) with no setter, so changing it does nothing right away. The renderer checks it once per frame (`lib/glow/WebGLRenderer.js:439`) and returns early when it is False. Nothing is drawn, but nothing is cleared either, so the last frame stays on screen. The camera still moves when the user drags, but it isn't redrawn, so it looks as if rotation is broken.\n\n## Proposed fix\n\nGive `visible` a setter in `canvas.js` that hides the 3D canvas when it is False and shows it again when it is True. That matches classic VPython, where the window goes away. Keep the renderer's early return so no GPU time is spent on a hidden canvas.\n\nDecided: `visible=False` hides only the 3D area. The canvas's title and caption stay visible.\n\nrsWVPRunner has the same code, so the fix needs porting there too.\n","author":{"url":"https://github.com/sspickle","@type":"Person","name":"sspickle"},"datePublished":"2026-11-13T08:57:58Z","url":"https://github.com/vpython/glowscript/issues/231"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:887f8d49-6f66-e655-85e1-315bc896ed64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9370:49948:6969C5:8F49B8:6B00774E |
| html-safe-nonce | d55b5763dda2b8e39ca04149662044aa4650fe2afdfd571c78c21a15283879ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzcwOjQ5OTQ4OjY5NjlDNTo4RjQ5Qjg6NkIwMDc3NEUiLCJ2aXNpdG9yX2lkIjoiMTkzODcxMzkzOTYwMDc2Njc5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6a0035d309e0dc90989b56d56ff0d6a13c84bb870089b2603641b2c9c80e4eb2 |
| hovercard-subject-tag | issue:6368149832 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vpython/glowscript/231/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e28494f139edd068d662d96af51e6f59a27a3722f3c643c89adb1d1d7513a7c/vpython/glowscript/issues/231 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e28494f139edd068d662d96af51e6f59a27a3722f3c643c89adb1d1d7513a7c/vpython/glowscript/issues/231 |
| og:image:alt | The docs say that with canvas.visible = False, "no objects are displayed in this canvas." Instead, the canvas freezes on its last frame. This was reported on the glowscript-users list on 2026-11-12... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sspickle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 75c2b65dd205f26961d0c29afed1a8d0bb7cca9f05780571dfd1ef93eb539d16 |
| turbo-cache-control | no-preview |
| go-import | github.com/vpython/glowscript git https://github.com/vpython/glowscript.git |
| octolytics-dimension-user_id | 1280757 |
| octolytics-dimension-user_login | vpython |
| octolytics-dimension-repository_id | 187905631 |
| octolytics-dimension-repository_nwo | vpython/glowscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 187905631 |
| octolytics-dimension-repository_network_root_nwo | vpython/glowscript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84e563eb4b55f8fa102f325f117533cee9e3df4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width