Skip to content

Commit 3f16d8d

Browse files
committed
UIButtonDraggable drag start position fix
1 parent 87bd1f2 commit 3f16d8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/UIButtonDraggable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ export default class UIButtonDraggable extends UIButton {
103103
if (!this._clip) {
104104
return;
105105
}
106-
this._startDragX = this._clip.x;
107-
this._startDragY = this._clip.y;
106+
this._startDragX = this._clip.x - gameObject.input.dragStartX;
107+
this._startDragY = this._clip.y - gameObject.input.dragStartY;
108108
}
109109

110110
/**
@@ -139,7 +139,7 @@ export default class UIButtonDraggable extends UIButton {
139139
_setupInteractive(zone) {
140140
super._setupInteractive(zone);
141141
this._dragZone = zone;
142-
zone.scene.input.dragDistanceThreshold = 3;
142+
//zone.scene.input.dragDistanceThreshold = 3;
143143
zone.scene.input.setDraggable(zone, true);
144144
zone.scene.input.on("dragstart", this._onDragStart, this);
145145
zone.scene.input.on("drag", this._onDrag, this);

0 commit comments

Comments
 (0)