2525 // The item instantiating the delegates
2626 property Item modelInstantiator: undefined
2727
28- readonly property bool isBackdrop: true
2928 // Node children for the Backdrop
3029 property var children: []
3130 property var childrenIndices: []
4039 property color baseColor: defaultColor
4140
4241 readonly property int minimumWidth: 200
43- readonly property int minumumHeight : 200
42+ readonly property int minimumHeight : 200
4443
4544 property point mousePosition: Qt .point (mouseArea .mouseX , mouseArea .mouseY )
4645
9796 }
9897
9998 // When the node is selected, update the children for it
100- // For node to consider another ndoe , it needs to be fully inside the backdrop area
99+ // For node to consider another node , it needs to be fully inside the backdrop area
101100 onSelectedChanged: {
102101 if (selected) {
103102 updateChildren ()
@@ -114,11 +113,11 @@ Item {
114113 const backdropRect = Qt .rect (root .node .x , root .node .y , root .node .nodeWidth , root .node .nodeHeight )
115114
116115 for (var i = 0 ; i < modelInstantiator .count ; ++ i) {
117- const delegate = modelInstantiator .itemAt (i). item
118- if (delegate === this )
116+ const delegate = modelInstantiator .getItemAt (i)
117+ if (! delegate || delegate === this )
119118 continue
120119
121- const delegateRect = Qt .rect (delegate .x , delegate .y , delegate .width , delegate .height );
120+ const delegateRect = Qt .rect (delegate .x , delegate .y , delegate .width , delegate .height )
122121 if (Geom2D .rectRectFullIntersect (backdropRect, delegateRect)) {
123122 indices .push (i)
124123 nodes .push (delegate)
@@ -147,8 +146,8 @@ Item {
147146 // Main Layout
148147 MouseArea {
149148 id: mouseArea
150- width: root .width ;
151- height: root .height ;
149+ width: root .width
150+ height: root .height
152151 drag .target : root
153152 // Small drag threshold to avoid moving the node by mistake
154153 drag .threshold : 2
@@ -201,12 +200,12 @@ Item {
201200 }
202201
203202 onReleased: {
204- root .resized (root .width , nodeContent .height );
203+ root .resized (root .width , nodeContent .height )
205204 }
206205 }
207206 }
208207
209- // Resize: left size
208+ // Resize: left side
210209 Rectangle {
211210 width: 4
212211 height: nodeContent .height
@@ -273,8 +272,8 @@ Item {
273272 root .height = root .height + mouseY
274273
275274 // Ensure a minimum height
276- if (root .height < root .minumumHeight ) {
277- root .height = root .minumumHeight
275+ if (root .height < root .minimumHeight ) {
276+ root .height = root .minimumHeight
278277 }
279278 }
280279 }
@@ -308,7 +307,7 @@ Item {
308307 let h = root .height - mouseY
309308
310309 // Ensure a minimum height
311- if (h > root .minumumHeight ) {
310+ if (h > root .minimumHeight ) {
312311 // Update the node's y position and the height
313312 root .y = root .y + mouseY
314313 root .height = h
@@ -318,7 +317,7 @@ Item {
318317
319318 onReleased: {
320319 // Dragging from the top moves the node as well
321- root .resizedAndMoved (root .width , root .height , Qt .point (root .x , root .y ));
320+ root .resizedAndMoved (root .width , root .height , Qt .point (root .x , root .y ))
322321 }
323322 }
324323 }
0 commit comments