Skip to content

Fix hit testing for transformed elements #280

@nicoburns

Description

@nicoburns

The correct way to handle hit testing elements with a transform applied is to:

  • If the element has a transform, compute the inverse transform and store it
  • When hit testing, apply the inverse transform to the pointer coordinates before testing the against the elements untransformed position.
  • A transform with scale(0) needs to be special cased. In that case there is no inverse of the transform matrix (but the element is invisible so we simply return false from any hit tests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions