If I make several scripts with Paperscript coding drawings in a random scale, be it lines of 0.1 length or 1000 length (script var value!), then how do I proceed making these several scripts viewable in several canvases that have the same size?
(Envision for example a webpage that shows several drawings in a same size html-canvas-box, all having a different drawing, each more zoomed in on an object, all coded with the correct values in Paperscript.)
In my case the canvas is 100% by 57.7% set in a div. I want the drawings I make in whatever scale to show up there with as a maximum of extra in my paperscript maybe setting the view height and width, or adjusting the scale.
Right now I am having a hard time to not have my view behave strangely.
When I use data-paper-resize="true"
, resize="true"
or nothing at all in the <canvas>
as an attribute, then what I am showing in my view doesn't remain the same in different browser sizes.
Is it that I used percentage for the canvas? Should I define something in my paperscript? Can I do this outside of the drawing script with some jQuery?
EDIT
When I change my CSS for the canvas from %
to em
my drawing is solid, like the examples on the site of paperjs itself. But also like on the site of paperjs itself, they are not responsive. Meaning you can adjust your browsers size and the canvas takes up the same amount of pixels on the screen. Not sure how this will work for me in the long run, like say with mobile devices...
It does cut out the strange behavior. Any ideas on making a fully responsive paperscript canvas that behaves normal?