-
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
+101
−8
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f691a77
New page: dommatrixreadonly.is2d
estelle 2d2e269
New page: dommatrixreadonly.is2d
estelle af575c5
isidentity
estelle 664285c
typo
estelle 364047e
remove properties that are not in the object
estelle 3697750
remove properties that are not in the object
estelle fc274e0
Merge branch 'main' into is2d
estelle 011619f
Merge branch 'main' into is2d
bsmth a963026
Merge branch 'main' into is2d
estelle 9ef6ba7
Edits per review
estelle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: "DOMMatrixReadOnly: is2D property" | ||
short-title: is2D | ||
slug: Web/API/DOMMatrixReadOnly/is2D | ||
page-type: web-api-instance-method | ||
browser-compat: api.DOMMatrixReadOnly.is2D | ||
--- | ||
|
||
{{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`. | ||
|
||
## Value | ||
|
||
A Boolean value. | ||
|
||
## Examples | ||
|
||
```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 | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("CSSTransformValue.is2D")}} | ||
- {{domxref("CSSTransformComponent.is2D")}} | ||
- CSS {{cssxref("transform-function")}} functions | ||
- CSS {{cssxref("transform")}} property | ||
- [CSS transforms](/en-US/docs/Web/CSS/CSS_transforms) module | ||
- SVG [`transform`](/en-US/docs/Web/SVG/Attribute/transform) attribute | ||
- {{domxref("CanvasRenderingContext2D")}} interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: "DOMMatrixReadOnly: isIdentity property" | ||
short-title: isIdentity | ||
slug: Web/API/DOMMatrixReadOnly/isIdentity | ||
page-type: web-api-instance-method | ||
browser-compat: api.DOMMatrixReadOnly.isIdentity | ||
--- | ||
|
||
{{APIRef("Geometry Interfaces")}}{{AvailableInWorkers}} | ||
|
||
The readonly **`isIdentity`** property of the {{domxref("DOMMatrixReadOnly")}} interface is a Boolean whose value is `true` if the matrix is the [identity matrix](https://en.wikipedia.org/wiki/Identity_matrix). | ||
|
||
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). | ||
|
||
## Value | ||
|
||
A Boolean value. | ||
|
||
## Examples | ||
|
||
```js | ||
// Initialize a 2D matrix | ||
const matrix = new DOMMatrix(); // create a matrix | ||
console.log(matrix.isIdentity); // output: true | ||
|
||
// Apply a transform that has no effect | ||
console.log(matrix.translate(0).isIdentity); // output: true | ||
|
||
// Apply a transform with effect: this rotates the matrix by 30deg | ||
console.log(matrix.rotate(30).isIdentity); // output: false | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("DOMMatrix")}} interface | ||
- {{domxref("CSSMatrixComponent")}} interface | ||
- {{domxref("CanvasRenderingContext2D")}} interface | ||
- CSS {{cssxref("transform-function/matrix()")}} function | ||
- CSS {{cssxref("transform")}} property | ||
- [CSS transforms](/en-US/docs/Web/CSS/CSS_transforms) module | ||
- SVG [`transform`](/en-US/docs/Web/SVG/Attribute/transform) attribute |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.