Skip to content

Commit 790817a

Browse files
committed
🐛 fix sticky end position
1 parent 12a0409 commit 790817a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Joystick.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ class Joystick extends React.Component<IJoystickProps, IJoystickState> {
294294
this.props.stop({
295295
type: "stop",
296296
// @ts-ignore
297-
x: this.props.sticky ? this.state.coordinates.relativeX : null,
297+
x: this.props.sticky ? ((this.state.coordinates.relativeX * 2) / this._baseSize) : null,
298298
// @ts-ignore
299-
y: this.props.sticky ? this.state.coordinates.relativeY : null,
299+
y: this.props.sticky ? ((this.state.coordinates.relativeY * 2) / this._baseSize): null,
300300
// @ts-ignore
301301
direction: this.props.sticky ? this.state.coordinates.direction : null,
302302
// @ts-ignore

0 commit comments

Comments
 (0)