()
| 550 | } |
| 551 | |
| 552 | updateOffsetFromParent() { |
| 553 | const scale = this.props.scale as number; |
| 554 | const parent = this.getParent(); |
| 555 | const self = this.getSelfElement(); |
| 556 | if (!parent || self === null) { |
| 557 | return { |
| 558 | top: 0, |
| 559 | left: 0, |
| 560 | }; |
| 561 | } |
| 562 | const parentRect = parent.getBoundingClientRect(); |
| 563 | const parentLeft = parentRect.left; |
| 564 | const parentTop = parentRect.top; |
| 565 | const selfRect = self.getBoundingClientRect(); |
| 566 | const position = this.getDraggablePosition(); |
| 567 | const scrollLeft = parent.scrollLeft; |
| 568 | const scrollTop = parent.scrollTop; |
| 569 | this.offsetFromParent = { |
| 570 | left: selfRect.left - parentLeft + scrollLeft - position.x * scale, |
| 571 | top: selfRect.top - parentTop + scrollTop - position.y * scale, |
| 572 | }; |
| 573 | } |
| 574 | |
| 575 | render() { |
| 576 | const { |
no test coverage detected