This commit is contained in:
2024-11-29 10:58:17 +01:00
parent 9289a829be
commit 26a8924bc8
5 changed files with 15 additions and 15 deletions

View File

@ -17,7 +17,7 @@ pub trait Select<'a> {
}
#[derive(Debug)]
struct LinearCoordView {
pub struct LinearCoordView {
rect: Rectangle<Virtual>,
idx: usize,
}
@ -165,17 +165,17 @@ impl<const STRIDE_NUM: usize> StrideMapping<STRIDE_NUM> {
physical_idx += length as usize;
size = Some(match size.take() {
None => Rectangle::new(
Coordinates::new(x.into(), y.into()),
Coordinates::new(x.into(), (y + length - 1).into()),
Coordinates::new(x, y),
Coordinates::new(x, (y + length - 1)),
),
Some(s) => Rectangle::new(
Coordinates::new(
min(s.top_left.x, x.into()),
min(s.top_left.y, y.into())
min(s.top_left.x, x),
min(s.top_left.y, y)
),
Coordinates::new(
max(s.bottom_right.x, x.into()),
max(s.bottom_right.y, (y + length - 1).into())
max(s.bottom_right.x, x),
max(s.bottom_right.y, (y + length - 1))
)
)
});
@ -260,7 +260,7 @@ impl<'a> StrideView<'a> {
map,
range,
step_size,
cur: range.top_left.clone()
cur: range.top_left
};
}
}
@ -289,7 +289,7 @@ impl<'a> CoordinateView<'a> for StrideView<'a> {
debug_assert!(self.cur.y <= cur_stride.y + cur_stride.length - 1, "coords={:?} out of bounds for stride={:?} view={:?}", self.cur, cur_stride, self);
// Move to the next coord and return
let physical_coords = self.cur.clone();
let physical_coords = self.cur;
self.cur.y += 1;
let virtual_coords = VirtualCoordinates::new(