jsveron23/react-chess

Measure distance value dynamically for animation movement

jsveron23 opened this issue · 1 comments

Issue

https://github.com/jsveron23/react-chess/blob/master/src/containers/DiagramContainer.js#L60

// for animation
if (isExist(past) && isEmpty(nextMovableTiles)) {
  const [prevSnapshot] = getPrevSnapshotList(past)

  animate = mesurePosition(snapshot, prevSnapshot, 49.75)
}

This is current code and 49.75 is not dynamic measured value from element.

Changes required

Pass mesurePosition function but not passing width. Measuring distance from svgWrapper HOC component.