mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 21:00:03 -04:00
Clean up example code
This commit is contained in:
@@ -11,12 +11,14 @@ use epaint::{ColorImage, Pos2, Vec2};
|
||||
|
||||
use crate::{Context, Id};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/// A unique identifier of a viewport.
|
||||
///
|
||||
/// Generated by [`Context`].
|
||||
///
|
||||
/// This is returned by [`Context::viewport_id`] and [`Context::parent_viewport_id`].
|
||||
#[derive(Hash, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Hash, PartialEq, Eq)]
|
||||
pub struct ViewportId(pub Id);
|
||||
|
||||
impl Default for ViewportId {
|
||||
@@ -40,6 +42,15 @@ impl ViewportId {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ViewportId> for Id {
|
||||
#[inline]
|
||||
fn from(id: ViewportId) -> Self {
|
||||
id.0
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/// This will deref to [`Self::this`].
|
||||
#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct ViewportIdPair {
|
||||
|
||||
Reference in New Issue
Block a user