@@ -266,7 +266,10 @@ private void displaceElement(int targetIndex, Transform displaced)
266266 _displacedObjectLE . preferredWidth = _draggingObjectOriginalSize . x ;
267267 _displacedObjectLE . preferredHeight = _draggingObjectOriginalSize . y ;
268268 _displacedObject . SetParent ( _reorderableList . Content , false ) ;
269- _displacedObject . rotation = _reorderableList . transform . rotation ;
269+ if ( ! _reorderableList . KeepItemRotation )
270+ {
271+ _displacedObject . rotation = _reorderableList . transform . rotation ;
272+ }
270273 _displacedObject . SetSiblingIndex ( _fromIndex ) ;
271274 // Force refreshing both lists because otherwise we get inappropriate FromList in ReorderableListEventStruct
272275 _reorderableList . Refresh ( ) ;
@@ -310,7 +313,10 @@ private void revertDisplacedElement()
310313 _displacedObjectLE . preferredWidth = _displacedObjectOriginalSize . x ;
311314 _displacedObjectLE . preferredHeight = _displacedObjectOriginalSize . y ;
312315 _displacedObject . SetParent ( _displacedObjectOriginList . Content , false ) ;
313- _displacedObject . rotation = _displacedObjectOriginList . transform . rotation ;
316+ if ( ! _reorderableList . KeepItemRotation )
317+ {
318+ _displacedObject . rotation = _displacedObjectOriginList . transform . rotation ;
319+ }
314320 _displacedObject . SetSiblingIndex ( _displacedFromIndex ) ;
315321 _displacedObject . gameObject . SetActive ( true ) ;
316322
@@ -382,7 +388,10 @@ public void OnEndDrag(PointerEventData eventData)
382388
383389 RefreshSizes ( ) ;
384390 _draggingObject . SetParent ( _currentReorderableListRaycasted . Content , false ) ;
385- _draggingObject . rotation = _currentReorderableListRaycasted . transform . rotation ;
391+ if ( ! _reorderableList . KeepItemRotation )
392+ {
393+ _draggingObject . rotation = _currentReorderableListRaycasted . transform . rotation ;
394+ }
386395 _draggingObject . SetSiblingIndex ( _fakeElement . GetSiblingIndex ( ) ) ;
387396
388397 //If the item is transferable, it can be dragged out again
@@ -474,7 +483,10 @@ private void CancelDrag()
474483 {
475484 RefreshSizes ( ) ;
476485 _draggingObject . SetParent ( _reorderableList . Content , false ) ;
477- _draggingObject . rotation = _reorderableList . Content . transform . rotation ;
486+ if ( ! _reorderableList . KeepItemRotation )
487+ {
488+ _draggingObject . rotation = _reorderableList . Content . transform . rotation ;
489+ }
478490 _draggingObject . SetSiblingIndex ( _fromIndex ) ;
479491
480492
0 commit comments