Skip to content
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 page: DOMMatrixReadOnly.is2d #37169

Merged
merged 10 commits into from
Jan 23, 2025
Merged

New page: DOMMatrixReadOnly.is2d #37169

merged 10 commits into from
Jan 23, 2025

Conversation

estelle
Copy link
Member

@estelle estelle commented Dec 10, 2024

@estelle estelle requested a review from a team as a code owner December 10, 2024 17:58
@estelle estelle requested review from wbamberg and removed request for a team December 10, 2024 17:58
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Dec 10, 2024
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Preview URLs

Flaws (17)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/DOMMatrix
Title: DOMMatrix
Flaw count: 7

  • macros:
    • /en-US/docs/Web/API/DOMMatrix/scaleSelf does not exist
    • /en-US/docs/Web/API/DOMMatrix/scale3dSelf does not exist
    • /en-US/docs/Web/API/DOMMatrix/rotateAxisAngleSelf does not exist
    • /en-US/docs/Web/API/DOMMatrix/rotateFromVectorSelf does not exist
    • /en-US/docs/Web/API/DOMMatrix/fromFloat32Array does not exist
    • and 2 more flaws omitted

URL: /en-US/docs/Web/API/DOMMatrixReadOnly
Title: DOMMatrixReadOnly
Flaw count: 10

  • macros:
    • /en-US/docs/Web/API/DOMMatrixReadOnly/rotateAxisAngle does not exist
    • /en-US/docs/Web/API/DOMMatrixReadOnly/rotate does not exist
    • /en-US/docs/Web/API/DOMMatrixReadOnly/rotateFromVector does not exist
    • /en-US/docs/Web/API/DOMMatrixReadOnly/scale3d does not exist
    • /en-US/docs/Web/API/DOMMatrixReadOnly/scaleNonUniform does not exist
    • and 5 more flaws omitted
External URLs (2)

URL: /en-US/docs/Web/API/DOMMatrixReadOnly
Title: DOMMatrixReadOnly


URL: /en-US/docs/Web/API/DOMMatrixReadOnly/isIdentity
Title: DOMMatrixReadOnly: isIdentity property

(comment last updated: 2025-01-12 02:59:57)

@bsmth bsmth self-requested a review January 8, 2025 09:41

{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}}

The readonly **`is2D`** property of the {{domxref("DOMMatrixReadOnly")}} interface is a Boolean flag that is `true` when the matrix is 2D. The value is `true` if the matrix was initialized as a 2D matrix and only 2D transformation operations were applied. Otherwise, the matrix is defined in 3D, and `is2D` is `false`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean or boolean? We use "boolean" down in Value.


The readonly **`is2D`** property of the {{domxref("DOMMatrixReadOnly")}} interface is a Boolean flag that is `true` when the matrix is 2D. The value is `true` if the matrix was initialized as a 2D matrix and only 2D transformation operations were applied. Otherwise, the matrix is defined in 3D, and `is2D` is `false`.

## Syntax
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


The identity matrix is one in which every value is `0` _except_ those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).

## Syntax
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 25 to 33
```js
// Initialize a 2D matrix
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.is2D); // output: true
// Transform in a 2D space
console.log(matrix.rotate(30).is2D); // output: true
// Apply a 3D transform
console.log(matrix.rotate(10, 20, 1).is2D); // output: false
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a mad picky comment, but I think it's more readable with whitespace:

Suggested change
```js
// Initialize a 2D matrix
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.is2D); // output: true
// Transform in a 2D space
console.log(matrix.rotate(30).is2D); // output: true
// Apply a 3D transform
console.log(matrix.rotate(10, 20, 1).is2D); // output: false
```
```js
// Initialize a 2D matrix
const matrix = new DOMMatrix(); // create a matrix
console.log(matrix.is2D); // output: true
// Transform in a 2D space
console.log(matrix.rotate(30).is2D); // output: true
// Apply a 3D transform
console.log(matrix.rotate(10, 20, 1).is2D); // output: false

Optional, but if you do it here do it for the other page too.

@estelle estelle requested a review from wbamberg January 12, 2025 03:01
@bsmth bsmth removed their request for review January 15, 2025 08:47
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks Estelle!

@wbamberg wbamberg merged commit c783eb1 into main Jan 23, 2025
10 checks passed
@wbamberg wbamberg deleted the is2d branch January 23, 2025 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants