Questions tagged [paperjs]

Paper.js is an open source JavaScript vector graphics scripting framework.

Paper.js is an open source vector graphics scripting framework that runs on top of the HTML5 Canvas. It offers a clean Scene Graph / Document Object Model and a lot of powerful functionality to create and work with vector graphics and bezier curves, all neatly wrapped up in a well designed, consistent and clean programming interface.

http://paperjs.org/about/

798 questions
31
votes
4 answers

Paper.js won't resize the canvas correctly

I'm trying out Paper.js for fun, but it seems I'm already stuck at the very start. Adding resize="true" to the canvas tag is supposed to make the element as high and wide as the browser window. However, doing that results in some rather strange…
vvye
  • 1,208
  • 1
  • 10
  • 25
16
votes
1 answer

Paper.js Resize Raster/TextItem/Path by Dragging

I'm aware that I can scale a Raster object in Paper.js, as well as a TextItem and a Path. However, I'd like to do this on dragging the selection lines or bounding box of a Raster, TextItem, or Path, just as you would when resizing an image in a…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
16
votes
2 answers

HTML5 Canvas redraw-cycle performance optimisations

We are building a CAD app that runs in a browser. C.A.D stands for Computer Aided Design. Illustrator, CorelDraw, AutoCAD etc are some examples of CAD apps. It's based on Paper.js, a very neat Canvas library that allows you to manipulate vectors…
nicholaswmin
  • 21,686
  • 15
  • 91
  • 167
14
votes
7 answers

paper.js how to set up multiple canvases using only javascript

I'm trying to use paper.js in a webapp, but I've been unable to get it to work with multiple canvases. It's like the scopes are getting mixed up between the canvases, so when I intend to draw on canvas 1, it appears on canvas 2. In each view, I'm…
frodo2975
  • 10,340
  • 3
  • 34
  • 41
10
votes
5 answers

How to use PaperJs with React?

I am trying to use PaperJs in one of my React components. I'm not sure where to use the paper.view.onFrame method in my component
Sachin Titus
  • 113
  • 1
  • 5
9
votes
3 answers

install paper.js and typings file in angular 2

I want to use paper.js in one of my components in Angular 2 but cannot seem to get it to work. The paper-full.js file runs when the component is loaded but it never recognizes the canvas. There is a typings file made by Clark-Stevenson (paper.d.ts)…
ToucanSamIAm
  • 99
  • 1
  • 5
9
votes
1 answer

Raster image is off-center after fit-to-page zooming in Paper.js

I'm working on a Paper.js application that puts a raster (an image) in the view. Then it zooms to fit the image so that all of it is visible at one time. It's mostly working, but the image ends up offset, like this: When it should look more like…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
8
votes
2 answers

Canvas element does not resize when using ReactJS and PaperJS together

I have found that canvas elements correctly resize on window resize when they are inside react components. They also resize correctly when used with PaperJS. However, they do not resize when used with PaperJS and ReactJS together. Is this an…
Eric
  • 466
  • 6
  • 11
8
votes
4 answers

Concurrent drawing with paper.js

I have an app that deals with drawing widget based upon paper.js. Several users can draw at the same time, and changes are broadcast to each other in real time. The problem is that I need to store the changes and show drawn image while document is…
Eugeny89
  • 3,797
  • 7
  • 51
  • 98
8
votes
1 answer

Change frame rate in paper.js

In Paper.js, is it possible to change the frame rate of the onFrame(event)function? The paper.js website tutorial says the function is by default called 60 times per second, but it does not include if it is possible (and how) to change the frame…
Jiri
  • 83
  • 5
8
votes
2 answers

recommended way to extend classes in Paper.js

Is there a recommended way to extend classes in Paper.js? In particular, I am interested in extending Path Pardon if my terminology is incorrect, but I am essentailly asking the same question about paper that is being asked about three here
jefftimesten
  • 366
  • 6
  • 13
8
votes
4 answers

can I linebreak in paper.js library

I'm trying to understand if there is a way to break a line ( \n ) in the paper.js textItem: http://paperjs.org/reference/textitem maybe there's a way to box it in somehow? I need it to breakline at the edges of a square.
Almog Dubin
  • 329
  • 2
  • 13
7
votes
2 answers

Gulp Uglify Producing Strange Characters from Paper.js Library

I'm using the Bower package of Paper.js in a project. I'm using Gulp for preparing the project for the browser. There are some characters, however, that look like this in…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
7
votes
3 answers

How to pan using paperjs

I have been trying to figure out how to pan/zoom using onMouseDrag, and onMouseDown in paperjs. The only reference I have seen has been in coffescript, and does not use the paperjs tools.
Sam P
  • 681
  • 5
  • 19
7
votes
1 answer

Implementing a Paper.js spiral raster example on server-side

I am trying to draw a spiral raster example (link) on a server (running Node.js). However, I am facing an issue where my path is not displayed on the exported frame and I can only see the downloaded image. Probably a silly mistake on my side,…
dmee3
  • 304
  • 2
  • 11
1
2 3
53 54