Skip to content

Commit

Permalink
🐛 fix sticky end position
Browse files Browse the repository at this point in the history
  • Loading branch information
elmarti committed Nov 24, 2022
1 parent 12a0409 commit 790817a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Joystick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ class Joystick extends React.Component<IJoystickProps, IJoystickState> {
this.props.stop({
type: "stop",
// @ts-ignore
x: this.props.sticky ? this.state.coordinates.relativeX : null,
x: this.props.sticky ? ((this.state.coordinates.relativeX * 2) / this._baseSize) : null,
// @ts-ignore
y: this.props.sticky ? this.state.coordinates.relativeY : null,
y: this.props.sticky ? ((this.state.coordinates.relativeY * 2) / this._baseSize): null,
// @ts-ignore
direction: this.props.sticky ? this.state.coordinates.direction : null,
// @ts-ignore
Expand Down

0 comments on commit 790817a

Please sign in to comment.