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 > IPositionable > getBoundingRectangle
Phương thức IPositionable.getBoundingHình chữ nhật()
Trả về hình chữ nhật giới hạn của phần tử trên giao diện người dùng tính bằng đơn vị pixel tương ứng với div chèn Blockly.
Chữ ký:
getBoundingRectangle(): Rect | null;
Trường hợp trả lại hàng:
ct | rỗng
Hộp giới hạn của các thành phần trên giao diện người dùng. Giá trị rỗng nếu các thành phần trên giao diện người dùng khác nên bỏ qua hộp giới hạn.
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-10-11 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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"]]