Fork me on GitHub
#membrane
<
2022-02-12
>
zimablue12:02:07

why does webGL use moveTo() and then you provide absolute points in methods like Bezier, it seems like a weird combination. Like you'd think either there's no "cursor" and you draw things by passing absolute start and end coordinates, or there IS an "cursor" but then you draw things by providing points RELATIVE to the cursor. Having a cursor but then providing absolute coordinates seems like the hardest way to have to do it

phronmophobic18:02:33

You can also use relative coordinates by calling https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/translate. Some use cases might prefer using absolute coordinates and some might prefer relative. You should be able to mix and match as desired.

zimablue12:02:16

Thanks, I didn't know about translate, that would let one use relative but still not pass both points, have to either call moveTo or use a helper function to wrap that. I know it's silly but it feels a bit mad to start writing convenience functions right at the bottom of the stack I have access to, although I guess it is unlikely to be the bottleneck

zimablue12:02:18

I'm new to fucking with graphics