File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
packages/dom/src/core/plugins/feedback Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import {
1616 generateUniqueId ,
1717 getDocument ,
1818 getFrameTransform ,
19- type Transform ,
2019 DOMRectangle ,
2120 getFrameElement ,
2221} from '@dnd-kit/dom/utilities' ;
@@ -155,20 +154,25 @@ export class Feedback extends Plugin<DragDropManager, FeedbackOptions> {
155154 x : initialCoordinates . x - relativeLeft ,
156155 y : initialCoordinates . y - relativeTop ,
157156 } ;
157+
158158 const sizeDelta = {
159159 width :
160- ( initialSize . width / initialFrameTransform . scaleX -
161- width / frameTransform . scaleX ) *
162- transformOrigin . x ,
160+ initialSize . width * initialFrameTransform . scaleX -
161+ width * frameTransform . scaleX ,
163162 height :
164- ( initialSize . height / initialFrameTransform . scaleY -
165- height / frameTransform . scaleY ) *
166- transformOrigin . y ,
163+ initialSize . height * initialFrameTransform . scaleY -
164+ height * frameTransform . scaleY ,
167165 } ;
166+
168167 const delta = {
169- x : coordinatesDelta . x / frameTransform . scaleX - sizeDelta . width ,
170- y : coordinatesDelta . y / frameTransform . scaleY - sizeDelta . height ,
168+ x :
169+ coordinatesDelta . x / frameTransform . scaleX +
170+ sizeDelta . width * transformOrigin . x ,
171+ y :
172+ coordinatesDelta . y / frameTransform . scaleY +
173+ sizeDelta . height * transformOrigin . y ,
171174 } ;
175+
172176 const projected = {
173177 left : left + delta . x ,
174178 top : top + delta . y ,
You can’t perform that action at this time.
0 commit comments