aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xrray.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-05-28 23:25:41 -0400
committerJosh Matthews <josh@joshmatthews.net>2023-05-28 23:54:02 -0400
commit0e8ac3fdac83227d4bbc8d1d74ea021fa627280a (patch)
treeb26c252a84a3e5e67158ef65385979fdb1174784 /components/script/dom/xrray.rs
parentdbff26bce05d404027ef5bbfd85fb5995e4726bc (diff)
downloadservo-0e8ac3fdac83227d4bbc8d1d74ea021fa627280a.tar.gz
servo-0e8ac3fdac83227d4bbc8d1d74ea021fa627280a.zip
Formatting.
Diffstat (limited to 'components/script/dom/xrray.rs')
-rw-r--r--components/script/dom/xrray.rs24
1 files changed, 20 insertions, 4 deletions
diff --git a/components/script/dom/xrray.rs b/components/script/dom/xrray.rs
index 029929ae37d..aca7f5b323d 100644
--- a/components/script/dom/xrray.rs
+++ b/components/script/dom/xrray.rs
@@ -38,7 +38,11 @@ impl XRRay {
}
}
- fn new(global: &GlobalScope, proto: Option<HandleObject>, ray: Ray<ApiSpace>) -> DomRoot<XRRay> {
+ fn new(
+ global: &GlobalScope,
+ proto: Option<HandleObject>,
+ ray: Ray<ApiSpace>,
+ ) -> DomRoot<XRRay> {
reflect_dom_object2(Box::new(XRRay::new_inherited(ray)), global, proto)
}
@@ -70,19 +74,31 @@ impl XRRay {
)
.normalize();
- Ok(Self::new(&window.global(), proto, Ray { origin, direction }))
+ Ok(Self::new(
+ &window.global(),
+ proto,
+ Ray { origin, direction },
+ ))
}
#[allow(non_snake_case)]
/// https://immersive-web.github.io/hit-test/#dom-xrray-xrray-transform
- pub fn Constructor_(window: &Window, proto: Option<HandleObject>, transform: &XRRigidTransform) -> Fallible<DomRoot<Self>> {
+ pub fn Constructor_(
+ window: &Window,
+ proto: Option<HandleObject>,
+ transform: &XRRigidTransform,
+ ) -> Fallible<DomRoot<Self>> {
let transform = transform.transform();
let origin = transform.translation;
let direction = transform
.rotation
.transform_vector3d(Vector3D::new(0., 0., -1.));
- Ok(Self::new(&window.global(), proto, Ray { origin, direction }))
+ Ok(Self::new(
+ &window.global(),
+ proto,
+ Ray { origin, direction },
+ ))
}
pub fn ray(&self) -> Ray<ApiSpace> {