Skip to content

Commit

Permalink
Click a spatial space view background to select the space view (#4796)
Browse files Browse the repository at this point in the history
### What

![click-spaceview](https://github.com/rerun-io/rerun/assets/1148717/ab71048d-1605-4696-97d8-da3fc02a749a)

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4796/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4796/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4796/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4796)
- [Docs
preview](https://rerun.io/preview/a2cfacc9ff862a1f3aba32a5019cbc271023fb66/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/a2cfacc9ff862a1f3aba32a5019cbc271023fb66/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
emilk committed Jan 12, 2024
1 parent ef2c8ff commit 79253f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/re_space_view_spatial/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ pub fn picking(
};
}

if hovered_items.is_empty() {
// If we hover nothing, we are hovering the space-view itself.
hovered_items.push(Item::SpaceView(query.space_view_id));
}

// Associate the hovered space with the first item in the hovered item list.
// If we were to add several, space views might render unnecessary additional hints.
// TODO(andreas): Should there be context if no item is hovered at all? There's no usecase for that today it seems.
Expand Down

0 comments on commit 79253f0

Please sign in to comment.