-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dependency between re_time_panel & re_viewport
- Loading branch information
Showing
11 changed files
with
114 additions
and
110 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// When showing grid-lines representing time. | ||
/// | ||
/// Given some spacing (e.g. 10s), return the next spacing (60s). | ||
pub fn next_grid_tick_magnitude_ns(spacing_ns: i64) -> i64 { | ||
if spacing_ns <= 1_000_000_000 { | ||
spacing_ns * 10 // up to 10 second ticks | ||
} else if spacing_ns == 10_000_000_000 { | ||
spacing_ns * 6 // to the whole minute | ||
} else if spacing_ns == 60_000_000_000 { | ||
spacing_ns * 10 // to ten minutes | ||
} else if spacing_ns == 600_000_000_000 { | ||
spacing_ns * 6 // to an hour | ||
} else if spacing_ns == 60 * 60 * 1_000_000_000 { | ||
spacing_ns * 12 // to 12 h | ||
} else if spacing_ns == 12 * 60 * 60 * 1_000_000_000 { | ||
spacing_ns * 2 // to a day | ||
} else { | ||
spacing_ns.checked_mul(10).unwrap_or(spacing_ns) // multiple of ten days | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters