Bản khảo sát nghiên cứu: Cho chúng tôi biết trải nghiệm của bạn khi sử dụng Blockly
Bắt đầu khảo sát
chặn > blockRendering > RenderInfo > đo lường
phương thức blockRendering.RenderInfo.measure()
Điền vào đối tượng này tất cả thông tin kích thước cần thiết để vẽ khối.
Lượt đo lường này không truyền các thay đổi vào khối (mặc dù các trường có thể chọn kết xuất lại khi getSize() được gọi). Tuy nhiên, việc gọi lại dữ liệu này nhiều lần có thể gây tốn kém.
Chữ ký:
measure(): void;
Trường hợp trả lại hàng:
void
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-21 UTC."],[[["The `blockRendering.RenderInfo.measure()` method calculates and stores the dimensions required to render a block."],["This method populates the RenderInfo object with sizing data without directly updating the block's visual representation, though it may trigger field rerendering."],["While crucial for rendering, repeatedly calling `measure()` can impact performance due to its computational cost."]]],["The `measure()` method within the `blockRendering.RenderInfo` class calculates and stores the necessary sizing data for rendering a block. This process doesn't alter the block itself, although fields might rerender upon size retrieval. It's important to note that repeated calls to `measure()` can be resource-intensive. The method takes no parameters and returns nothing (void). Its primary function is to determine and populate the sizing information required for block drawing.\n"]]