Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd static type for different coordinate systems and length units #2226
Comments
This was referenced May 15, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We currently use primitive types like
intandf32for measurements which may be in various coordinate planes with different origins and transforms (screen coordinates, window coordinates, framebuffer coordinates, page coordinates, layer coordinates) and in different units (CSS px, hardware pixels, device-independent "pixels", appunits).We should add types for some or all of these, and statically-checked conversions between units and between coordinate systems. (Currently we have one such type,
Au(appunit), which also defines conversions to untyped "px" and "pt" units.)For comparison, here are some of the relevant types and functions in Gecko: