UA Ledger · Playable Test Bench · draft for review

Translate viewport taps into the scaled stage's coordinates

Teaching laboratory. Cases run in this page against the authored functions. This is not a device panel, network approval, analytics-delivery proof or campaign result. Inputs are synthetic.

A tap can land on the visible target and still miss the game's hit test. This fixture reproduces the error caused by mixing viewport coordinates with an offset, scaled stage.

Primary documentation: MDN: pointer coordinate (body read 2026-09-19).

Cases

CaseInputExpectedFixedBroken

What a pass does not prove

A pass proves the inverse mapping for the supplied one-dimensional examples. A real hit test also needs the corresponding vertical mapping, a defined content rectangle and treatment of transformed ancestors. The central acceptance rule is that rendering and interaction agree on the same origin and scale.