Use fixed-size pixel chunks in readonly rendering test
This commit is contained in:
@@ -182,7 +182,9 @@ async fn mounted_readonly_input_keeps_selection_copy_and_readable_paint() {
|
||||
let pixels = Headless::screenshot(&mut renderer, Size::new(480, 64), 1.0, BG);
|
||||
let style = selectable_input(&theme, text_input::Status::Disabled);
|
||||
let selection_pixels: Vec<_> = pixels
|
||||
.chunks_exact(4)
|
||||
.as_chunks::<4>()
|
||||
.0
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, pixel)| near(pixel, style.selection, 3))
|
||||
.map(|(index, _)| (index % 480, index / 480))
|
||||
@@ -196,7 +198,9 @@ async fn mounted_readonly_input_keeps_selection_copy_and_readable_paint() {
|
||||
let top = selection_pixels.iter().map(|p| p.1).min().unwrap();
|
||||
let bottom = selection_pixels.iter().map(|p| p.1).max().unwrap();
|
||||
let glyph_pixels = pixels
|
||||
.chunks_exact(4)
|
||||
.as_chunks::<4>()
|
||||
.0
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(index, pixel)| {
|
||||
let (x, y) = (index % 480, index / 480);
|
||||
|
||||
Reference in New Issue
Block a user