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

Fix drag-drop and simplification code

This commit is contained in:
Emil Ernerfeldt
2023-04-24 17:04:10 +02:00
parent ce7ed11542
commit 13ec65cf08
5 changed files with 153 additions and 49 deletions

View File

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