研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >svgResize
svgResize 变量
调整 SVG 图片的大小,使其完全填充其容器。当视图实际改变大小(例如,在调整窗口大小/设备屏幕方向时)时调用此方法。如需在内容发生更改时(例如添加或移除块时)调整工作区大小,请参阅 workspace.resizeContents。记录 SVG 图片的高度/宽度。
Signature:
svgResize: typeof common.svgResize
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["`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."]]],[]]