Paperjs 0.9.25 - item.setRampPoint is not a function

871 Views Asked by At

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?

2

There are 2 best solutions below

2
On BEST ANSWER

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

0
On

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.