mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-18 00:07:00 +02:00
fix Exit; document Size
This commit is contained in:
parent
0273d2ac75
commit
cb382cf12e
3 changed files with 8 additions and 4 deletions
2
dizzle
2
dizzle
|
|
@ -1 +1 @@
|
|||
Subproject commit 2dbf9d8797a3642f69813be4ef3613836e061b94
|
||||
Subproject commit 4da276af7be5690f0a7a763de3710433a9700c3c
|
||||
|
|
@ -4,7 +4,7 @@ use crate::Usually;
|
|||
#[derive(Clone)] pub struct Exit(Arc<AtomicBool>);
|
||||
|
||||
impl Exit {
|
||||
pub fn run <T> (run: impl Fn(Self)->Usually<T>) -> Usually<T> {
|
||||
pub fn run <T> (run: impl FnOnce(Self)->Usually<T>) -> Usually<T> {
|
||||
run(Self(Arc::new(AtomicBool::new(false))))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@ use super::*;
|
|||
/// Uses [AtomicUsize] to measure size during\
|
||||
/// rendering (which is normally read-only).
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct Size(Arc<AtomicUsize>, Arc<AtomicUsize>);
|
||||
pub struct Size(
|
||||
/// Width
|
||||
pub Arc<AtomicUsize>,
|
||||
/// Height
|
||||
pub Arc<AtomicUsize>,
|
||||
);
|
||||
|
||||
impl PartialEq for Size {
|
||||
fn eq (&self, _: &Self) -> bool {
|
||||
|
|
@ -31,4 +36,3 @@ impl Size {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue