File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515 getElementMargin ,
1616 getLockPixelOffsets ,
1717 getPosition ,
18+ getLinearDistance ,
1819 isTouchEvent ,
1920 limit ,
2021 NodeType ,
@@ -191,7 +192,7 @@ export default function sortableContainer(
191192 x : this . position . x - position . x ,
192193 y : this . position . y - position . y ,
193194 } ;
194- const combinedDelta = Math . abs ( delta . x ) + Math . abs ( delta . y ) ;
195+ const combinedDelta = getLinearDistance ( Math . abs ( delta . x ) , Math . abs ( delta . y ) ) ;
195196
196197 this . delta = delta ;
197198
Original file line number Diff line number Diff line change @@ -272,6 +272,10 @@ export function getContainerGridGap(element) {
272272 return { x : 0 , y : 0 } ;
273273}
274274
275+ export function getLinearDistance ( deltaX , deltaY ) {
276+ return Math . sqrt ( deltaX ** 2 , deltaY ** 2 ) ;
277+ }
278+
275279export const KEYCODE = {
276280 TAB : 9 ,
277281 ESC : 27 ,
You can’t perform that action at this time.
0 commit comments