Hacker News new | ask | show | jobs
by Killswitch 3808 days ago
Nice write up, Justin! I was one of the first engineers at a competitor of TeeSpring's, and we tackled the same problems. We used Fabric.js in our second iteration (first was jQuery).
2 comments

We have a similar feature at 43Layers (e.g. [1]) and went through a couple iterations. Ours was made more complex because it has to mesh with a 3D canvas, so originally it was a combination of overlapping DOM elements, an SVG element, and a 3D canvas. We also use React, so movement of the selection box created events that generally had to flow through multiple react elements. Getting the coordinates of everything matching in all three contexts was an exercise in annoyance (given how simple it seems), especially for things like fonts which have bounding boxes which bear only a passing relationship with the actual bounding boxes of the text on screen.

Eventually, we ditched the SVG and moved more things into 3D, which made for a better design in the end. For example, now we calculate 3D geometry for the font from its curves and get an actual real bounding box for it.

Anyway, it's interesting to read about how other people solved the same problem.

1: https://www.43layers.com/products/laser-cut-coasters/Custom-...

We used fabric.js as well to create custom laser printed/engraved products. As with you, our first iteration was just standard javascript with jQuery, but fabric.js made a lot of things much easier.
Do you have a link to your site? I'm working on some similar stuff and would love to see what you've done.
Hey, sorry I didn't see this before. You can go to www.loveandrobots.com, any example using upswing image files should use fabric.js
Thanks! That site is like an eery Dublin-doppelganger of my plans, would be cool to chat with you about it (though I get the impression you're no longer with them).
I'm no longer the CTO, but I'm still friends with the rest of the founders and lend a hand every now and again (I'm still a shareholder in the company).

Drop me a line at malonso [at] loopbit.com if you want :)