JohnMcLear / draw

A real time collaborative drawing tool using nodejs, socket.io & paper.js
Apache License 2.0
482 stars 158 forks source link

responsive draw #270

Open supun19 opened 6 years ago

supun19 commented 6 years ago

can you suggest me to how to draw responsive for all the screen.

JohnMcLear commented 6 years ago

Can you explain exactly what you mean?

supun19 commented 6 years ago

I have two major issues. One is some of the points (i.e. points drawn close to the edges in larger screens like laptop )cannot be seen in mobile view. I doubt whether it's due to mobile view not having larger cordinates like the laptop view. The other problem is if I draw in larger screen and switch to a smaller view some the drawings cannot be seen instead of dropping the ratio and showing the whole drawing. Can you help me out? I can contribute to fix this if it's necessary

supun19 commented 6 years ago

This is the way how we tried. We made up the canvas to 14:9 ratio. Whatever the size of the screen, we sent cordinates converted to 1400:900 canvas. It worked but we faced several problems, one was, a long line was drawn at the start of drawing. We couldn't find a method to convert the cordinates loaded from the db which are in 1400:900 cordinate system. Can you suggest me a method? We used 'resize' method in paper js to scale the current coordinates when the window is resized. But we couldn't find how to apply the scale method in paper js. Can you suggest me a good method?