@internal
(event: DragEvent, el: HTMLElement, parent: HTMLElement)
| 402 | |
| 403 | /** @internal */ |
| 404 | protected _getDragOffset(event: DragEvent, el: HTMLElement, parent: HTMLElement): DragOffset { |
| 405 | |
| 406 | // in case ancestor has transform/perspective css properties that change the viewpoint |
| 407 | let xformOffsetX = 0; |
| 408 | let xformOffsetY = 0; |
| 409 | if (parent) { |
| 410 | xformOffsetX = this.dragTransform.xOffset; |
| 411 | xformOffsetY = this.dragTransform.yOffset; |
| 412 | } |
| 413 | |
| 414 | const targetOffset = el.getBoundingClientRect(); |
| 415 | let x = this.option.rtl ? targetOffset.right : targetOffset.left; |
| 416 | let offsetX = this.option.rtl |
| 417 | ? (event.clientX - targetOffset.right + xformOffsetX) |
| 418 | : (-event.clientX + targetOffset.left - xformOffsetX); |
| 419 | |
| 420 | return { |
| 421 | x, |
| 422 | top: targetOffset.top, |
| 423 | offsetX, |
| 424 | offsetTop: - event.clientY + targetOffset.top - xformOffsetY, |
| 425 | width: targetOffset.width * this.dragTransform.xScale, |
| 426 | height: targetOffset.height * this.dragTransform.yScale |
| 427 | }; |
| 428 | } |
| 429 | |
| 430 | /** @internal starts or continues auto-scroll when the dragged helper is clipped by the scroll container. |
| 431 | * Takes the grid's own element to find the scroll container so external/sidebar drags work too (#2074). */ |
no outgoing calls
no test coverage detected