Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
blockly > blockRendering > RenderInfo > ukur
Metode blockRendering.RenderInfo.measure()
Isi objek ini dengan semua informasi ukuran yang diperlukan untuk menggambar blok.
Tahap pengukuran ini tidak menyebarkan perubahan pada blok (meskipun kolom dapat memilih untuk dirender ulang saat getSize() dipanggil). Namun, memanggilnya berulang kali mungkin mahal.
Tanda Tangan:
measure(): void;
Hasil:
void
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-21 UTC.
[null,null,["Terakhir diperbarui pada 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"]]