playcanvas / playcanvas/engine

Touch#getTouchTargetCoords return wrong value when touched on fixed elements

Open
#2,427 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Description

From the source code, we can know that getTouchTargetCoords is based on currentElement, but if the current element is a fixed element, it will return wrong value.

Steps to Reproduce
  1. Open https://playcanv.as/b/33yrNufe/ on mobile, or open the source project on desktop.
  2. Move camera distance by two touches, make sure your first touch is on the canvas, and the second touch is on the fixed element
    image
  3. You will see camera distance updated unexpectedly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/input/touch.js lines 172-191 and reproduce the problem using the linked mobile demo or source project. Trace getTouchTargetCoords when the second touch is on a fixed element; done means fixed-element touches no longer produce incorrect coordinates or unexpectedly update the camera distance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.