Skip to content

Commit

Permalink
Expand docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jun 11, 2024
1 parent 16d78c6 commit 972751d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/re_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,16 @@ pub fn apply_style_and_install_loaders(egui_ctx: &egui::Context) {
design_tokens().apply(egui_ctx);
}

/// Is this Ui in a resizable panel?
///
/// Used as a heuristic to figure out if it is safe to truncate text.
///
/// If this returns false, we should never truncate.
/// In a resizable panel, it is safe to truncate text if it doesn't fit,
/// because the user can just make the panel wider to see the full text.
///
/// In other places, we should never truncate text, because then the user
/// cannot read it all. In those places (when this functions returns `false`)
/// you should either wrap the text or let it grow the Ui it is in.
fn is_in_resizable_panel(ui: &egui::Ui) -> bool {
re_tracing::profile_function!();

Expand Down

0 comments on commit 972751d

Please sign in to comment.