javascript - Rappid.js - getScreenCTM returns null in Firefox -
i have encountered problem causing me headaches on past few days.
i have web page users can create sort of sequence diagram (using joint.js , rappid.js v1.7.1). idea - user has nodes available can dragged onto canvas (paper in joint.js) , these nodes can linked each other.
the functionality on works great in chrome , internet explorer, can't seem work in firefox (version 47.0.1).
as drop node on canvas following error: 
as said error occurs in firefox , using firefox , chrome debugger functions able tell "same" object receive svg matrix in chrome while null in firefox.
the node contains svg image content:
defaults: joint.util.deepsupplement({ type: 'stations.startpoint', attrs: { '.stations-point-title-text': { 'text': 'start' }, '.stations-point-content-image': { "xlink:href": "data:image/svg+xml;base64,..." } } }, stations.point.prototype.defaults) the line of code in rappid.js error occurs
gettransformtoelement: function (a) { return a.getscreenctm().inverse().multiply(this.node.getscreenctm()) }, has had similar experience joint.js? or tips appreciated.
thanks
edit: found solution issue, although must confess don't quite understand it. after analysis of demo program worked in firefox figured out difference wasn't calling navigator.render() functionality in code (since wasn't using navigator). adding call resolved problem. (http://jointjs.com/rappid/docs/ui/navigator)
once moved 0.9.5 problem disappears. make sure include in index.html
< script > svgelement.prototype.gettransformtoelement = svgelement.prototype.gettransformtoelement || function(toelement) { return toelement.getscreenctm().inverse().multiply(this.getscreenctm()); };< / script >
Comments
Post a Comment