Skip to content

Pinch-zoom / UI scaling 🔍 #27

@chrisheninger

Description

@chrisheninger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions