1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

egui_extras: fix bug when restoring persisted table widths

This commit is contained in:
Emil Ernerfeldt
2022-04-11 14:27:32 +02:00
parent e97241861e
commit efc0b992e0
3 changed files with 76 additions and 43 deletions

View File

@@ -20,3 +20,31 @@ pub(crate) use crate::layout::StripLayout;
pub use crate::sizing::Size;
pub use crate::strip::*;
pub use crate::table::*;
/// Log an error with either `tracing` or `eprintln`
#[doc(hidden)]
#[macro_export]
macro_rules! log_err {
($fmt: literal, $($arg: tt)*) => {{
#[cfg(feature = "tracing")]
tracing::error!($fmt, $($arg)*);
#[cfg(not(feature = "tracing"))]
eprintln!(
concat!("egui_extras: ", $fmt), $($arg)*
);
}};
}
/// Panic in debug builds, log otherwise.
#[doc(hidden)]
#[macro_export]
macro_rules! log_or_panic {
($fmt: literal, $($arg: tt)*) => {{
if cfg!(debug_assertions) {
panic!($fmt, $($arg)*);
} else {
$crate::log_err!($fmt, $($arg)*);
}
}};
}