mirror of
https://github.com/storytold/egui.git
synced 2026-11-30 02:04:50 +01:00
Add TexturePoll::texture_id
This commit is contained in:
1 parent
4060d02f27
commit
25903d0a02
1 file changed
+10
-2
+10
-2
@@ -439,12 +439,20 @@ pub enum TexturePoll {
|
||||
|
||||
impl TexturePoll {
|
||||
#[inline]
|
||||
pub fn size(self) -> Option<Vec2> {
|
||||
pub fn size(&self) -> Option<Vec2> {
|
||||
match self {
|
||||
TexturePoll::Pending { size } => size,
|
||||
TexturePoll::Pending { size } => *size,
|
||||
TexturePoll::Ready { texture } => Some(texture.size),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn texture_id(&self) -> Option<TextureId> {
|
||||
match self {
|
||||
TexturePoll::Pending { .. } => None,
|
||||
TexturePoll::Ready { texture } => Some(texture.id),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type TextureLoadResult = Result<TexturePoll>;
|
||||
|
||||
Reference in new issue
Block a user