Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinch-zoom / UI scaling 🔍 #27

Open
chrisheninger opened this issue May 27, 2019 · 0 comments
Open

Pinch-zoom / UI scaling 🔍 #27

chrisheninger opened this issue May 27, 2019 · 0 comments

Comments

@chrisheninger
Copy link
Member

Game is hard to play on a phone– could benefit from some UI scaling– along with pinch-zoom to adjust the scale.

Started some work here:

// Zoom
// if (gestureState.numberActiveTouches === 2) {
// // WIP: Requires significant updates to the way we're handling card drop
// let dx = Math.abs(
// e.nativeEvent.touches[0].pageX - e.nativeEvent.touches[1].pageX
// );
// let dy = Math.abs(
// e.nativeEvent.touches[0].pageY - e.nativeEvent.touches[1].pageY
// );
// let distance = Math.sqrt(dx * dx + dy * dy);
// let scale = (distance / this.distance) * this._previousScale;
// // minScale to maxScale
// if (scale > 0.5 && scale < 2) {
// // this.setState({ scale, lastMovePinch: true });
// this._tableStyles.style.transform = [{ scale }];
// }
// }

I think I want to rewrite it using translate instead of top/left for positioning the viewport– this will require changing a bit of the card drop logic.

@chrisheninger chrisheninger changed the title Pinch-zoom / UI scaling Pinch-zoom / UI scaling 🔍 Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant