Skip to content

DIRECTION_NONE on swipe #72

Open
Open
@ScallyGames

Description

@ScallyGames

I have a swipe listener with <tag hm-swipe="$ctrl.swipe" hm-recognizer-options='[{"type": "swipe", "directions": "DIRECTION_ALL"}]'> and when it fires I get a parameter object with param.direction = 1 (DIRECTION_NONE).

I've read through the hammer.js source and the only reason of this happening is when deltaX === deltaY. On my object however I have param.deltaX = 229 and param.deltaY = -59.

It is hard to create a MCVE for this but for now I can at least a simplified version of the event params (from that alone it doesn't seem to do what the source code says)

{
    "angle": -14.447590714840283,
    "center": 
    {
        "x":321,
        "y":404
    },
    "deltaTime":616,
    "deltaX":229,
    "deltaY":-59,
    "direction":1,
    "distance":236.47832881682837,
    "isFinal":true,
    "isFirst":false,
    "maxPointers":1,
    "offsetDirection":4,
    "overallVelocity":0.3717532467532468,
    "overallVelocityX":0.3717532467532468,
    "overallVelocityY":-0.09577922077922078,
    "pointerType":"touch",
    "rotation":0,
    "scale":1,
    "type":"swipe",
    "velocity":0,
    "velocityX":0,
    "velocityY":0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions