aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/canvasrenderingcontext2d.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-02-13 12:03:42 -0500
committerGitHub <noreply@github.com>2020-02-13 12:03:42 -0500
commit2c70db5f5b3f418807bc13d503ffb9d1d7fe425b (patch)
tree2799eb43f3819c1175f0dbbb725a7feeb494fffc /components/script/dom/canvasrenderingcontext2d.rs
parente3a2301efe911dfa232803a293f62c16ffdd3925 (diff)
parent588c09b5807bd9534aa63cbb11cff5c0227efdab (diff)
downloadservo-2c70db5f5b3f418807bc13d503ffb9d1d7fe425b.tar.gz
servo-2c70db5f5b3f418807bc13d503ffb9d1d7fe425b.zip
Auto merge of #25734 - pylbrecht:get.transform, r=jdm
Implement CanvasRenderingContext2D.getTransform() <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script/dom/canvasrenderingcontext2d.rs')
-rw-r--r--components/script/dom/canvasrenderingcontext2d.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs
index 4c36a22f717..5956827d654 100644
--- a/components/script/dom/canvasrenderingcontext2d.rs
+++ b/components/script/dom/canvasrenderingcontext2d.rs
@@ -18,6 +18,7 @@ use crate::dom::bindings::root::{Dom, DomRoot, LayoutDom};
use crate::dom::bindings::str::DOMString;
use crate::dom::canvasgradient::CanvasGradient;
use crate::dom::canvaspattern::CanvasPattern;
+use crate::dom::dommatrix::DOMMatrix;
use crate::dom::globalscope::GlobalScope;
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
use crate::dom::imagedata::ImageData;
@@ -224,6 +225,11 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
self.canvas_state.borrow().transform(a, b, c, d, e, f)
}
+ // https://html.spec.whatwg.org/multipage/#dom-context-2d-gettransform
+ fn GetTransform(&self) -> DomRoot<DOMMatrix> {
+ self.canvas_state.borrow().get_transform(&self.global())
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-context-2d-settransform
fn SetTransform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) {
self.canvas_state.borrow().set_transform(a, b, c, d, e, f)