Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENA-83: Ability to Zoom In and Zoom Out responsively #238

Open
dmalan opened this issue Sep 2, 2022 · 3 comments
Open

ENA-83: Ability to Zoom In and Zoom Out responsively #238

dmalan opened this issue Sep 2, 2022 · 3 comments

Comments

@dmalan
Copy link

dmalan commented Sep 2, 2022

Expected Behavior

In the browser version of Scratch, it's possible to Zoom In and Zoom Out responsively, as via command-plus and command-minus on a Mac, whereby the entire UI resizes (not just the code area).

We use such when teaching on a projector (zooming in 150% typically), so as to make UI elements more visible, particularly for students farther back.

Actual Behavior

As best I can tell on the desktop version, there might not be a similar feature, unless it's another set of keyboard shortcuts?

By contrast, Electron apps like VS Code desktop do to resize with command-{plus,minus}, per https://github.com/microsoft/vscode/blob/main/src/vs/platform/window/electron-sandbox/window.ts. And a manual workaround (e.g., for a teacher in class) seems to be executing document.body.style.zoom = '150%' in Electron's dev tools

Steps to Reproduce

  1. Install https://scratch.mit.edu/download for macOS.
  2. Launch Scratch desktop app.
  3. Try to zoom in/out with command-{plus,minus}.

System Details

macOS 12.5.1, Scratch desktop 3.29.1.

Screenshots

Browser version, zoomed in

web

Desktop version, not zoomed in

desktop

Thank you!

CC @rongxin-liu @CarterZenke

@cwillisf
Copy link
Contributor

cwillisf commented Sep 8, 2022

We should definitely implement a way to adjust the overall zoom! Not only is it helpful for presenting to a room, as you suggested, but it can also be an accessibility feature for an individual.

Here's a workaround for people who are comfortable with the browser console, though it's a poor substitute for the proper feature. Note that this works only in the Mac or Windows app, not on the web or Android / Chrome OS versions. (We also need to implement zoom in the Android app!)

First, open the browser console with Ctrl+Shift+i on Windows, or Cmd+Opt+i on Mac. Then, type this in the console:

const {webFrame} = require('electron');
webFrame.setZoomLevel(1);
webFrame.setZoomFactor(1.3);

You can use setZoomLevel to change the zoom in browser-defined increments, where 0 means "normal" zoom, or setZoomFactor to set the zoom level exactly, where 1 means 100% zoom.

More information is available here: https://zeke.github.io/electron.atom.io/docs/api/web-frame/

@cwillisf
Copy link
Contributor

cwillisf commented Sep 8, 2022

Somewhat related to LLK/scratch-android#58

@cwillisf cwillisf changed the title Ability to Zoom In and Zoom Out responsively ENA-83: Ability to Zoom In and Zoom Out responsively Oct 11, 2022
@domluther
Copy link

We should definitely implement a way to adjust the overall zoom! Not only is it helpful for presenting to a room, as you suggested, but it can also be an accessibility feature for an individual.

Here's a workaround for people who are comfortable with the browser console, though it's a poor substitute for the proper feature. Note that this works only in the Mac or Windows app, not on the web or Android / Chrome OS versions. (We also need to implement zoom in the Android app!)

First, open the browser console with Ctrl+Shift+i on Windows, or Cmd+Opt+i on Mac. Then, type this in the console:

const {webFrame} = require('electron');
webFrame.setZoomLevel(1);
webFrame.setZoomFactor(1.3);

You can use setZoomLevel to change the zoom in browser-defined increments, where 0 means "normal" zoom, or setZoomFactor to set the zoom level exactly, where 1 means 100% zoom.

More information is available here: https://zeke.github.io/electron.atom.io/docs/api/web-frame/

Given that code works just fine (but is very fiddly to do), could this please be added to a feature? As mentioned, I can change the visibility of the code but it means the blocks themselves can be very hard for students to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants