styling fix and clippy fixes
This commit is contained in:
1 parent
1364ff62b8
commit
4137f787bf
17 files changed
+123
-75
No files matched your search
@@ -242,12 +242,11 @@ impl Ferese {
|
||||
scale,
|
||||
cursor.map(|rect| (&*self, rect)),
|
||||
)
|
||||
} else if let Some(mut backend) = self.direct_backend.take() {
|
||||
} else {
|
||||
let mut backend = self.direct_backend.take()?;
|
||||
let result = backend.capture_window_frame(self, &window, &output, cursor);
|
||||
self.direct_backend = Some(backend);
|
||||
result
|
||||
} else {
|
||||
return None;
|
||||
};
|
||||
let pixels = result.ok()?;
|
||||
if let Some(toplevel) = window.toplevel() {
|
||||
|
||||
@@ -126,7 +126,7 @@ fn crossed(barrier: &Barrier, edge: Edge, from: (f64, f64), to: (f64, f64)) -> O
|
||||
} else {
|
||||
from.0 + (to.0 - from.0) * fraction
|
||||
};
|
||||
(fraction >= 0.0 && fraction <= 1.0 && along >= start && along < end).then_some(fraction)
|
||||
((0.0..=1.0).contains(&fraction) && along >= start && along < end).then_some(fraction)
|
||||
}
|
||||
|
||||
struct Session {
|
||||
|
||||
@@ -193,7 +193,7 @@ pub(crate) fn capture_window_frame(
|
||||
return Err("Incomplete window readback".into());
|
||||
}
|
||||
let mut pixels = source[..bytes].to_vec();
|
||||
for pixel in pixels.chunks_exact_mut(4) {
|
||||
for pixel in pixels.as_chunks_mut::<4>().0 {
|
||||
pixel.swap(0, 2);
|
||||
let alpha = pixel[3] as u16;
|
||||
for channel in &mut pixel[..3] {
|
||||
|
||||
Reference in new issue
Block a user