proper doc comments

This commit is contained in:
2025-03-27 14:53:36 -04:00
parent 50e85dec90
commit eee266979c
7 changed files with 27 additions and 31 deletions

View File

@@ -14,12 +14,12 @@ impl Buf {
}
}
// Truncate x and y and return a corresponding index into the data slice.
/// Truncate x and y and return a corresponding index into the data slice.
const fn index(&self, x: f32, y: f32) -> usize {
crate::util::index(self.width, self.height, x, y)
}
// Get the buffer value at a given position. The implementation effectively treats data as periodic, hence any finite position will produce a value.
/// Get the buffer value at a given position. The implementation effectively treats data as periodic, hence any finite position will produce a value.
pub fn get_buf(&self, x: f32, y: f32) -> f32 {
self.buf[self.index(x, y)]
}