-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New pages: DOMMatrixReadOnly.skewX/skewY/rotate #37152
base: main
Are you sure you want to change the base?
Conversation
Preview URLs (9 pages)
Flaws (10)Note! 3 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
URL:
URL:
URL:
(comment last updated: 2025-01-12 03:01:28) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a few comment which applied to most of these pages, that I didn't note everywhere:
- consider pretty-printing comments (and try to keep tgem under 80 characters, or they get hard-wrapped)
- I'm not sure how relevant the CSS "see also" links are.
The `rotateAxisAngleSelf()` method of the {{domxref("DOMMatrix")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by rotating the source matrix by the given vector and angle. The original matrix is not altered. | ||
|
||
To rotate a matrix without mutating it, see {{domxref("DOMMatrix.rotateAxisAngleSelf()")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence and the last sentence of the previous para seems wrong?
- : A number; the y-coordinate of the vector denoting the axis of rotation. If undefined, the `rotX` value is used. If non-zero, [`is2D`](/en-US/docs/Web/API/DOMMatrix#is2d) is false. | ||
- `rotZ` {{optional_inline}} | ||
- : A number; the z-coordinate of the vector denoting the axis of rotation. If undefined, the `rotX` value is used. If non-zero, [`is2D`](/en-US/docs/Web/API/DOMMatrix#is2d) is false. | ||
- `angle` {{optional_inline}} | ||
- : A number; the angle of the rotation around the axis vector, in degrees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spec suggests that is it x and y that affect is2D:
If x or y are not 0 or -0, set is 2D of the current matrix to false.
// "matrix3d(0.728, 0.609, -0.315, 0, -0.525, 0.791, 0.315, 0, 0.441, -0.063, 0.895, 0, 0, 0, 0, 1)" | ||
console.log(matrix.toString()); | ||
// "matrix3d(0.728, 0.609, -0.315, 0, -0.525, 0.791, 0.315, 0, 0.441, -0.063, 0.895, 0, 0, 0, 0, 1)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth pretty-printing these comments so they are more readable.
- CSS {{cssxref("transform")}} property | ||
- CSS {{cssxref("rotate")}} property | ||
- CSS {{cssxref("transform-function")}} functions | ||
- {{cssxref("transform-function/rotate", "rotate()")}} | ||
- {{cssxref("transform-function/rotate3d", "rotate3d()")}} | ||
- {{cssxref("transform-function/rotateX", "rotateX()")}} | ||
- {{cssxref("transform-function/rotateY", "rotateY()")}} | ||
- {{cssxref("transform-function/rotateZ", "rotateZ()")}} | ||
- [CSS transforms](/en-US/docs/Web/CSS/CSS_transforms) module | ||
- SVG [`transform`](/en-US/docs/Web/SVG/Attribute/transform) attribute | ||
- {{domxref("CanvasRenderingContext2D")}} interface methods | ||
- {{domxref("CanvasRenderingContext2D.rotate()")}} | ||
- {{domxref("CanvasRenderingContext2D.transform()")}} | ||
- {{domxref("CanvasRenderingContext2D.setTransform()")}} | ||
- {{domxref("CanvasRenderingContext2D.resetTransform()")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that clear what the relevance of these transform/rotate pages are to this method. I mean it's not like you need to use matrices to rotate an item in CSS.
|
||
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} | ||
|
||
The `rotateFromVectorSelf()` method of the {{domxref("DOMMatrix")}} interface is a mutable transformation method that modifies a matrix. It modifies the matrix by rotating the matrix by the angle between the specified vector and `(1, 0)`. The rotation angle is determined by the angle between the vector `(1,0)T` and `(x,y)T` in the clockwise direction, or `(+/-)arctan(y/x)`. If `x` and `y` are both `0`, the angle is specified as `0`, returning the altered {{domxref("DOMMatrix")}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first sentence here isn't ideal because it doesn't say what the method does, just that it mutates the matrix. Better to combine the first two sentences, something like:
The
rotateFromVectorSelf()
method of the {{domxref("DOMMatrix")}} modifies the matrix by rotating the matrix by the angle between the specified vector and(1, 0)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last sentence here "If x
and y
are both 0
, the angle is specified as 0
, returning the altered {{domxref("DOMMatrix")}}." is strange because if the angle is 0 isn't the matrix unchanged? So how can it be "altered"?
The **`scale3d()`** method of the {{domxref("DOMMatrixReadOnly")}} interface creates a new matrix being the result of the 3D scale transform being applied | ||
to the matrix. It returns a new {{domxref("DOMMatrix")}} created by scaling the source 3d matrix by the given scale factor centered on the origin point specified by the origin parameters, with a default origin of `(0, 0, 0)`. The original matrix is not modified. | ||
|
||
To mutate the matrix as you 3D-rotate it, see {{domxref("DOMMatrix.scale3dSelf()")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To mutate the matrix as you 3D-rotate it, see {{domxref("DOMMatrix.scale3dSelf()")}} | |
To mutate the matrix as you 3D-scale it, see {{domxref("DOMMatrix.scale3dSelf()")}}. |
|
||
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} | ||
|
||
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified. | |
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, "X axis" or X-axis"? (or x-axis or x axis). Below you have X axis.
|
||
The `skewX()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its X-axis. The original matrix is not modified. | ||
|
||
To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}} | |
To mutate the matrix as you skew it along the X-axis, see {{domxref("DOMMatrix.skewXSelf()")}}. |
|
||
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} | ||
|
||
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified. | |
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about Y-axis or Y axis.
|
||
The `skewY()` method of the {{domxref("DOMMatrixReadOnly")}} interface is a transformation method that returns a new {{domxref("DOMMatrix")}} created by applying the specified skew transformation to the source matrix along its Y-axis. The original matrix is not modified. | ||
|
||
To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}} | |
To mutate the matrix as you skew it along the Y-axis, see {{domxref("DOMMatrix.skewYSelf()")}}. |
part of openwebdocs/project#214