Skip to content

Commit

Permalink
Fix timeseries legend control (#4941)
Browse files Browse the repository at this point in the history
### What
 - Resolves: #4905

### 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/4941/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4941/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/4941/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/4941)
- [Docs
preview](https://rerun.io/preview/fb4d418b498342b8b660669cb3a1455ffcc53948/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/fb4d418b498342b8b660669cb3a1455ffcc53948/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
jleibs authored Jan 29, 2024
1 parent 4371783 commit 470d08b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/re_space_view_time_series/src/space_view_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ impl SpaceViewClass for TimeSeriesSpaceView {
});

if legend.visible {
plot = plot.legend(Legend::default().position(DEFAULT_LEGEND_CORNER));
plot = plot.legend(
Legend::default().position(legend.corner().unwrap_or(DEFAULT_LEGEND_CORNER)),
);
}

if timeline.typ() == TimeType::Time {
Expand Down

0 comments on commit 470d08b

Please sign in to comment.