javascript - Set an image to fill the canvas using Paper.js -


i have image has same aspect ratio canvas different resolution. know can make use of view size, view.viewsize, trouble setting dimensions of image. have tried setting width using raster.width = 2000;, example, not seem work.

use raster.bounds instead

(for width)

raster.bounds.width = 2000; 

or

(for height)

raster.bounds.height = 2000; 

so, right, should able canvas size with:

paper.view.viewsize 

and assign raster proper with/height


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -