You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Matrix objects have *self methods that transforms the current matrix rather than creating a new object. If this is a pattern to avoid garbage in hot code, then point.matrixTransformSelf seems missing.
point.matrixTransformSelf would behave like point.matrixTransform, except the context object would be modified, rather than creating a new DOMPoint.
The text was updated successfully, but these errors were encountered:
@jakearchibald Since DOMPoint doesn't have any *self methods like DOMMatrix. I don't think we even thought about adding *self to DOMPoint to be honest. Do you think that this can move to level 2 of the spec?
I'll leave it to you to decide. Btw I'm writing as a web developer, not an implementor, I can't really speak for implementation interest on this.
In my use case I'm looping through some ImageData data, and creating some new ImageData as the result of a transform, so I'm calling point.matrixTransform for each pixel.
So we probably didn't thought about other use cases at the time. Also, creating new instances of matrix with 16 slots (and another for is2D) is heavier than transformations on DOMPoint. I still see value on *Self in general though.
https://drafts.fxtf.org/geometry/#DOMPoint
Matrix objects have
*self
methods that transforms the current matrix rather than creating a new object. If this is a pattern to avoid garbage in hot code, thenpoint.matrixTransformSelf
seems missing.point.matrixTransformSelf
would behave likepoint.matrixTransform
, except the context object would be modified, rather than creating a newDOMPoint
.The text was updated successfully, but these errors were encountered: