mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-02 16:28:51 +02:00
[GraphEditor] Return empty bbox if the graph is empty
This commit checks whether there is a node in the graph before trying to determine the size and position of the bounding box. If the graph is empty, an bounding box set with 0s is returned.
This commit is contained in:
parent
c428015bdc
commit
da2c3fda05
1 changed files with 3 additions and 0 deletions
|
@ -1019,6 +1019,9 @@ Item {
|
|||
|
||||
function boundingBox() {
|
||||
var first = nodeRepeater.itemAt(0)
|
||||
if (first === null) {
|
||||
return Qt.rect(0, 0, 0, 0)
|
||||
}
|
||||
var bbox = Qt.rect(first.x, first.y, first.x + first.width, first.y + first.height)
|
||||
for (var i = 0; i < root.graph.nodes.count; ++i) {
|
||||
var item = nodeRepeater.itemAt(i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue