blockly > svgResize
svgResize variable
Size the SVG image to completely fill its container. Call this when the view actually changes sizes (e.g. on a window resize/device orientation change). See workspace.resizeContents to resize the workspace when the contents change (e.g. when a block is added or removed). Record the height/width of the SVG image.
Signature:
svgResize: typeof common.svgResize
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["`svgResize` is a function used to resize the SVG image within its container to ensure it fills the space completely."],["This function should be called when the container's size changes, such as during window resizing or device orientation changes."],["`svgResize` is distinct from `workspace.resizeContents`, which is used for resizing when the workspace content changes (e.g., adding or removing blocks)."],["The function records the updated height and width of the SVG image after resizing."]]],[]]