Browse Source

`include_image!` now accepts expressions (#4521)

Closes https://github.com/emilk/egui/issues/4510
pull/4524/head
YgorSouza 6 months ago
committed by GitHub
parent
commit
7035aa4e53
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      crates/egui/src/lib.rs

2
crates/egui/src/lib.rs

@ -507,7 +507,7 @@ pub fn warn_if_debug_build(ui: &mut crate::Ui) {
/// ``` /// ```
#[macro_export] #[macro_export]
macro_rules! include_image { macro_rules! include_image {
($path: literal) => { ($path:expr $(,)?) => {
$crate::ImageSource::Bytes { $crate::ImageSource::Bytes {
uri: ::std::borrow::Cow::Borrowed(concat!("bytes://", $path)), uri: ::std::borrow::Cow::Borrowed(concat!("bytes://", $path)),
bytes: $crate::load::Bytes::Static(include_bytes!($path)), bytes: $crate::load::Bytes::Static(include_bytes!($path)),

Loading…
Cancel
Save