Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paperjs 0.9.25 - item.setRampPoint is not a function

I have been using paperjs for a year now, without any issues. After a Chrome update (Version 55.0.2883.87 m) some production code that I hadn't touched for 2 months started failing with the error: item.setRampPoint is not a function:

paper-full.js:13213 Uncaught TypeError: item.setRampPoint is not a function

at offset (paper-full.js:13213)
at Object.<anonymous> (paper-full.js:13263)
at Object.forIn (paper-full.js:46)
at Function.each (paper-full.js:133)
at applyAttributes (paper-full.js:13260)
at importGroup (paper-full.js:12944)
at importSVG (paper-full.js:13324)
at Project.importSVG (paper-full.js:13356)
at drawAddLaneButtons (tlc.js:267)
at Path.window.drawTlcElements (tlc.js:62)

If I comment out the call to setRamPoint in the paperjs code it starts working again.

This happens when I try to load a SVG to the page, but, as I said before, it was working fine for a long time.

I am using version 0.9.25 of paperjs.

Any ideas?

like image 824
Nelson Larios Avatar asked Dec 22 '16 18:12

Nelson Larios


2 Answers

We had the same problem and updated to newly PaperJS version. It worked

like image 82
André Luís Oliveira Avatar answered Oct 22 '22 03:10

André Luís Oliveira


If someone wants to avoid updating paperjs.
A simple hack could be :

if (!paper.Item.prototype.setRampPoint) {
     paper.Item.prototype.setRampPoint = function () {};
}

Doesn't seem to break anything.

like image 38
not-a-robot Avatar answered Oct 22 '22 02:10

not-a-robot