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

Fix: handle IconData::default() without crashing (#3842)

* Closes https://github.com/emilk/egui/issues/3839
This commit is contained in:
Emil Ernerfeldt
2024-01-19 14:24:26 +01:00
committed by GitHub
parent 76ec982958
commit 3936418f0b
2 changed files with 26 additions and 8 deletions

View File

@@ -170,6 +170,13 @@ pub struct IconData {
pub height: u32,
}
impl IconData {
#[inline]
pub fn is_empty(&self) -> bool {
self.rgba.is_empty()
}
}
impl std::fmt::Debug for IconData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("IconData")