mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
add axis clamp
This commit is contained in:
parent
932e3a5427
commit
ea397b7ed7
2 changed files with 6 additions and 4 deletions
|
|
@ -23,7 +23,8 @@ macro_rules! impl_axis_common { ($A:ident $T:ty) => {
|
||||||
|
|
||||||
pub struct FixedAxis<T> {
|
pub struct FixedAxis<T> {
|
||||||
pub start: T,
|
pub start: T,
|
||||||
pub point: Option<T>
|
pub point: Option<T>,
|
||||||
|
pub clamp: Option<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_axis_common!(FixedAxis u16);
|
impl_axis_common!(FixedAxis u16);
|
||||||
|
|
@ -32,7 +33,8 @@ impl_axis_common!(FixedAxis usize);
|
||||||
pub struct ScaledAxis<T> {
|
pub struct ScaledAxis<T> {
|
||||||
pub start: T,
|
pub start: T,
|
||||||
pub scale: T,
|
pub scale: T,
|
||||||
pub point: Option<T>
|
pub point: Option<T>,
|
||||||
|
pub clamp: Option<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_axis_common!(ScaledAxis u16);
|
impl_axis_common!(ScaledAxis u16);
|
||||||
|
|
|
||||||
|
|
@ -229,8 +229,8 @@ impl<E: Engine> PhraseEditor<E> {
|
||||||
notes_out: Arc::new(RwLock::new([false;128])),
|
notes_out: Arc::new(RwLock::new([false;128])),
|
||||||
keys: keys_vert(),
|
keys: keys_vert(),
|
||||||
buffer: Default::default(),
|
buffer: Default::default(),
|
||||||
note_axis: FixedAxis { start: 12, point: Some(36) },
|
note_axis: FixedAxis { start: 12, point: Some(36), clamp: Some(127) },
|
||||||
time_axis: ScaledAxis { start: 0, scale: 24, point: Some(0) },
|
time_axis: ScaledAxis { start: 0, point: Some(0), clamp: Some(0), scale: 24 },
|
||||||
focused: false,
|
focused: false,
|
||||||
entered: false,
|
entered: false,
|
||||||
mode: false,
|
mode: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue