Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
blockly > IPositionable > getBoundingRectangle
Metode IPositionable.getBoundingRectangle()
Menampilkan persegi panjang pembatas elemen UI dalam unit piksel yang relatif terhadap div injeksi Blockly.
Tanda Tangan:
getBoundingRectangle(): Rect | null;
Hasil:
Persegi | null (kosong)
Kotak pembatas elemen UI. Null jika kotak pembatas harus diabaikan oleh elemen UI lainnya.
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-10-11 UTC.
[null,null,["Terakhir diperbarui pada 2024-10-11 UTC."],[[["The `getBoundingRectangle()` method provides the coordinates and dimensions of an IPositionable element within the Blockly workspace."],["It returns a `Rect` object containing the element's bounding box information or `null` if it should be disregarded by other UI elements."]]],["The `getBoundingRectangle()` method, part of the `IPositionable` interface, calculates and returns the bounding rectangle of a UI element. This rectangle is defined in pixel units relative to the Blockly injection div. The method's return value is either a `Rect` object representing the bounding box or `null` if the bounding box should be ignored. This information allows other UI elements to determine their position.\n"]]