aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xrspace.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-10-02 19:01:55 -0700
committerManish Goregaokar <manishsmail@gmail.com>2019-10-03 12:22:15 -0700
commit1062249fd8457fb01a9d06649a8a1f8d355b1d6d (patch)
treeab7d2b807791ad30ee517f3b99bfdac8598974cf /components/script/dom/xrspace.rs
parent0780fb0693d46ce321889e5222c5025b800415c2 (diff)
downloadservo-1062249fd8457fb01a9d06649a8a1f8d355b1d6d.tar.gz
servo-1062249fd8457fb01a9d06649a8a1f8d355b1d6d.zip
Make poses nullable
Diffstat (limited to 'components/script/dom/xrspace.rs')
-rw-r--r--components/script/dom/xrspace.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/xrspace.rs b/components/script/dom/xrspace.rs
index 6fa00d1cffe..8162a558542 100644
--- a/components/script/dom/xrspace.rs
+++ b/components/script/dom/xrspace.rs
@@ -57,9 +57,9 @@ impl XRSpace {
/// The reference origin used is common between all
/// get_pose calls for spaces from the same device, so this can be used to compare
/// with other spaces
- pub fn get_pose(&self, base_pose: &Frame) -> ApiPose {
+ pub fn get_pose(&self, base_pose: &Frame) -> Option<ApiPose> {
if let Some(reference) = self.downcast::<XRReferenceSpace>() {
- reference.get_pose(base_pose)
+ Some(reference.get_pose(base_pose))
} else if let Some(source) = self.input_source.get() {
// XXXManishearth we should be able to request frame information
// for inputs when necessary instead of always loading it
@@ -72,7 +72,7 @@ impl XRSpace {
.iter()
.find(|i| i.id == id)
.expect("no input found");
- cast_transform(frame.target_ray_origin)
+ Some(cast_transform(frame.target_ray_origin))
} else {
unreachable!()
}