Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Last active August 5, 2021 13:18
Show Gist options
  • Save zsoltk/8670288bba58292fb5b9a7df8163628f to your computer and use it in GitHub Desktop.
Save zsoltk/8670288bba58292fb5b9a7df8163628f to your computer and use it in GitHub Desktop.
val fromPosition = properties.fromState.board.find(piece)?.position
val currentOffset = fromPosition
?.toCoordinate(properties.isFlipped)
?.toOffset(properties.squareSize)
val targetOffset = toPosition
.toCoordinate(properties.isFlipped)
.toOffset(properties.squareSize)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment