Skip to content

feat: [UEPR-268] change canvas svg to rgenerate when containing container resizes #3355

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MiroslavDionisiev
Copy link

Resolves

UEPR-268

Proposed Changes

Currently the canvas svg regenerates when window resizes. However new features require to resize the editor without changing the window size. This cause the canvas to be bigger or smaller than the div that contains it. This changes make it so the canvas regenerates when the containing div changes size.

Blockly.hideChaffOnResize(true);
Blockly.svgResize(mainWorkspace);
});
mainWorkspace.setResizeHandlerWrapper(workspaceResizeHandler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code kept track of this handler and would remove it in the workspace's dispose() function. Do we need to do something equivalent in the new code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I added logic for disconnecting the observer

@cwillisf
Copy link
Contributor

Also, the test failure appears to be due to the browser failing to load the JS file(s). It seems like --allow-file-access-from-files would be the right solution, but that isn't working for me. Any thoughts?

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

Successfully merging this pull request may close these issues.

2 participants