@@ -53,6 +53,7 @@ export function getDragItems(
5353 extent : n . extent ,
5454 parentNode : n . parentNode ,
5555 dimensions : n . dimensions ,
56+ expandParent : n . expandParent ,
5657 } ) ,
5758 )
5859}
@@ -132,7 +133,10 @@ export function getExtent<T extends NodeDragItem | GraphNode>(
132133) {
133134 let currentExtent = item . extent || extent
134135
135- if ( currentExtent === 'parent' || ( ! Array . isArray ( currentExtent ) && currentExtent ?. range === 'parent' ) ) {
136+ if (
137+ ( currentExtent === 'parent' || ( ! Array . isArray ( currentExtent ) && currentExtent ?. range === 'parent' ) ) &&
138+ ! item . expandParent
139+ ) {
136140 if ( item . parentNode && parent && item . dimensions . width && item . dimensions . height ) {
137141 const parentExtent = getParentExtent ( currentExtent , item , parent )
138142
@@ -152,7 +156,7 @@ export function getExtent<T extends NodeDragItem | GraphNode>(
152156 [ currentExtent [ 0 ] [ 0 ] + parentX , currentExtent [ 0 ] [ 1 ] + parentY ] ,
153157 [ currentExtent [ 1 ] [ 0 ] + parentX , currentExtent [ 1 ] [ 1 ] + parentY ] ,
154158 ]
155- } else if ( currentExtent ?. range && Array . isArray ( currentExtent . range ) ) {
159+ } else if ( currentExtent !== 'parent' && currentExtent ?. range && Array . isArray ( currentExtent . range ) ) {
156160 const [ top , right , bottom , left ] = getExtentPadding ( currentExtent . padding )
157161
158162 const parentX = parent ?. computedPosition . x || 0
@@ -164,7 +168,14 @@ export function getExtent<T extends NodeDragItem | GraphNode>(
164168 ]
165169 }
166170
167- return currentExtent as CoordinateExtent
171+ return (
172+ currentExtent === 'parent'
173+ ? [
174+ [ Number . NEGATIVE_INFINITY , Number . NEGATIVE_INFINITY ] ,
175+ [ Number . POSITIVE_INFINITY , Number . POSITIVE_INFINITY ] ,
176+ ]
177+ : currentExtent
178+ ) as CoordinateExtent
168179}
169180
170181function clampNodeExtent ( { width, height } : Dimensions , extent : CoordinateExtent ) : CoordinateExtent {
0 commit comments