Pomax / custom-graphics-element

Because what if you could just... write graphics sketches? On the web? Like, directly?
MIT License
16 stars 1 forks source link

add "natural" coordinates #8

Open Pomax opened 6 months ago

Pomax commented 6 months ago

The canvas uses (0,0) as upper left, instead of lower-left, with +Y running down, instead of up.

This is dumb, let's add some code that changes that (while giving people control over whether or not to use that).

Pomax commented 4 months ago

Note that this will almost certainly involve something like:

let hy = __ natural_coordinates ? screenToWorld(0, height).y : false;
someFunction(x, hy ? hy - y : y, ...)

rewrites to everything