Skip to content

Commit d44dd77

Browse files
committed
fix: inline dragOffset and offsetTop in initial
1 parent 5ae0dcc commit d44dd77

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/minimap-element.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,12 +1178,10 @@ class MinimapElement {
11781178
if (!this.minimap) { return }
11791179
if (!isLeftMouse && !isMiddleMouse) { return }
11801180

1181-
const { top } = this.visibleArea.getBoundingClientRect()
1182-
const { top: offsetTop } = this.getBoundingClientRect()
1183-
1184-
const dragOffset = y - top
1185-
1186-
const initial = { dragOffset, offsetTop }
1181+
const initial = {
1182+
dragOffset: y - this.visibleArea.getBoundingClientRect().top,
1183+
offsetTop: this.getBoundingClientRect().top
1184+
}
11871185

11881186
const mousemoveHandler = (e) => this.drag(extractMouseEventData(e), initial)
11891187
const mouseupHandler = (e) => this.endDrag()

0 commit comments

Comments
 (0)