-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Conversation
Preview URLs
Flaws (17)Note! 2 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
External URLs (2)URL:
URL:
(comment last updated: 2025-01-12 02:59:57) |
|
||
{{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`. |
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.
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 |
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.
Property pages don't have Syntax: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_property_subpage_template
|
||
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 |
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.
As above, property pages don't have Syntax: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/API_property_subpage_template
```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 | ||
``` |
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 is a mad picky comment, but I think it's more readable with whitespace:
```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.
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.
👍 thanks Estelle!
part of openwebdocs/project#214