Closed georeith closed 9 years ago
At the moment it's only implemented on Item. But you're right, it should exist on all classes. You can always use instanceof for your use-case though.
@lehni Ah okay, I was just checking if there was a reason why not. I'll work on a pull request for this.
Thanks, but no need for a pull request. I know exactly what to do for this to materialize.
@lehni Didn't doubt it, I've noticed in the mean time they still have the private property _class
set, so I just put that in a function getClassName()
which I will swap out later.
I'm not sure if there is a reason for this, but classes like
Curve
orSegment
don't have theclassName
property.I would like to see
className
implemented as a property of all PaperJS classes. Consider my use case where I use the same function to apply a transformation to both aSegment
orPath
. I can't use the inbuilttransform()
function as I need to memorise the origin andSegment
doesn't implement a transformation matrix.I can easily duck type test the
Segment
by checking forpoint
vsposition
but it feels wrong when most other classes have theclassName
which makes my code much more readable for someone new to the library.Is there any reason why this shouldn't be implemented?