Open dotnetCarpenter opened 4 years ago
The reason a native point was used here is that there simply wasnt no SVG.Point when I wrote this plugin :)
@Fuzzyma Should event.detail.m
be an instance of SVG.Matrix then?
There is a small overhead of using the class instead of a native DOMMatrix
(getScreenCTM()
). But it makes sense that both properties are svg.js classes. I'm just not sure what improvement it will give. I don't have a use-case.
Alright, I will put this on the backlog ^^
I might have an hour now to fix this
Sorry, no I do not have time now. But I will try to fix this, this week.
Just to be clear. This can be merged when SVG.Matrix
is being used instead of this.el.node.getScreenCTM().inverse()
and use SVG.Point.transform(this.m)
instead of this.p.native().matrixTransform(this.m)
.
And lastly, we can use this.m = this.el.getScreenCTM().inverse()
instead of this.m = this.el.node.getScreenCTM().inverse()
.
I might throw in an example folder to manually test the new code is working...
One typo: in svg.js its screenCTM and not getScreenCTM. But no pressure. This plugin needs a rework at some point anyway. Github just launched its new notification dashboard and this PR came up. So I want this merged, release it and then make the whole plugin compatible to svg.js v3
Instead of doing:
You can now do:
Please see #57 for more info.