diff --git a/packages/dom/src/core/plugins/feedback/Feedback.ts b/packages/dom/src/core/plugins/feedback/Feedback.ts index 0ff36de0..54f88418 100644 --- a/packages/dom/src/core/plugins/feedback/Feedback.ts +++ b/packages/dom/src/core/plugins/feedback/Feedback.ts @@ -16,7 +16,6 @@ import { generateUniqueId, getDocument, getFrameTransform, - type Transform, DOMRectangle, getFrameElement, } from '@dnd-kit/dom/utilities'; @@ -155,20 +154,25 @@ export class Feedback extends Plugin { x: initialCoordinates.x - relativeLeft, y: initialCoordinates.y - relativeTop, }; + const sizeDelta = { width: - (initialSize.width / initialFrameTransform.scaleX - - width / frameTransform.scaleX) * - transformOrigin.x, + initialSize.width * initialFrameTransform.scaleX - + width * frameTransform.scaleX, height: - (initialSize.height / initialFrameTransform.scaleY - - height / frameTransform.scaleY) * - transformOrigin.y, + initialSize.height * initialFrameTransform.scaleY - + height * frameTransform.scaleY, }; + const delta = { - x: coordinatesDelta.x / frameTransform.scaleX - sizeDelta.width, - y: coordinatesDelta.y / frameTransform.scaleY - sizeDelta.height, + x: + coordinatesDelta.x / frameTransform.scaleX + + sizeDelta.width * transformOrigin.x, + y: + coordinatesDelta.y / frameTransform.scaleY + + sizeDelta.height * transformOrigin.y, }; + const projected = { left: left + delta.x, top: top + delta.y,