Hacker News new | ask | show | jobs
by isuckatcoding 1812 days ago
The one thing that I always wonder about things like this which is basically Figma or Miro is how you persist / store the coordinate of the nodes given the user might have different screen sizes or resize their window etc.
1 comments

the screen, or rather whatever container is rendered on the page, is just a viewport to an underlying canvas. The canvas can be zoomed and panned, and the focus of the panning and level of the zoom can be synced across machines. People with different size or shape viewports see slightly different cropping, but they are looking at a synchronised canvas through that viewport.
Hmm Right that makes sense but you have to give some width/height to the container right?

I guess you can set it something absurdly large.