Commit ef0d6a15 authored by Romain Vimont's avatar Romain Vimont Committed by Romain Vimont

Remove go_up() and go_left() from PlaneMutSlice

These functions return a subslice that exceed its parent slice. We want
to avoid this behavior for tiling.
parent bdff1ea7
......@@ -554,17 +554,6 @@ impl<'a, T: Pixel> PlaneMutSlice<'a, T> {
}
// FIXME: code duplication with PlaneSlice
/// A slice starting i pixels above the current one.
pub fn go_up(&self, i: usize) -> PlaneSlice<'_, T> {
PlaneSlice { plane: self.plane, x: self.x, y: self.y - i as isize }
}
/// A slice starting i pixels to the left of the current one.
pub fn go_left(&self, i: usize) -> PlaneSlice<'_, T> {
PlaneSlice { plane: self.plane, x: self.x - i as isize, y: self.y }
}
pub fn p(&self, add_x: usize, add_y: usize) -> T {
let new_y =
(self.y + add_y as isize + self.plane.cfg.yorigin as isize) as usize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment