Draw bar for backlight

This commit is contained in:
Kenny Levinsen
2019-08-01 00:09:51 +02:00
parent e426e1f884
commit 14a1611e9e
4 changed files with 48 additions and 10 deletions
+13 -6
View File
@@ -11,12 +11,19 @@ pub enum Input {
}
impl Input {
pub fn offset(&self, offset: (u32, u32)) -> Input{
match self {
Input::Click{pos, button} => Input::Click{pos: (pos.0 - offset.0, pos.1 - offset.1), button: *button},
Input::Scroll{pos, x, y} => Input::Scroll{pos: (pos.0 - offset.0, pos.1 - offset.1), x: *x, y: *y},
}
}
pub fn offset(&self, offset: (u32, u32)) -> Input {
match self {
Input::Click { pos, button } => Input::Click {
pos: (pos.0 - offset.0, pos.1 - offset.1),
button: *button,
},
Input::Scroll { pos, x, y } => Input::Scroll {
pos: (pos.0 - offset.0, pos.1 - offset.1),
x: *x,
y: *y,
},
}
}
}
pub trait ModuleImpl {