แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
blockly > svgResize
ตัวแปร svgทั้งหมด
ปรับขนาดรูปภาพ SVG ให้เต็มคอนเทนเนอร์ เรียกใช้เมื่อมุมมองเปลี่ยนขนาดจริง (เช่น เมื่อปรับขนาดหน้าต่าง/การวางแนวของอุปกรณ์) ดู workspace.resizeContents เพื่อปรับขนาดพื้นที่ทำงานเมื่อเนื้อหาเปลี่ยนแปลง (เช่น เมื่อเพิ่มหรือนำบล็อกออก) บันทึกความสูง/ความกว้างของรูปภาพ SVG
ลายเซ็น:
svgResize: typeof common.svgResize
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-22 UTC
[null,null,["อัปเดตล่าสุด 2024-08-22 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."]]],[]]