We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86d2d2c commit 1f331f1Copy full SHA for 1f331f1
src/image/native_image.rs
@@ -247,7 +247,7 @@ impl NativeImage {
247
pub fn swap_word_rows(&mut self) {
248
let bpp = self.format.get_size().get_bpp();
249
// Use ceiling division to handle non-byte-aligned widths correctly
250
- let bytes_per_row = (self.width * bpp + 7) / 8;
+ let bytes_per_row = (self.width * bpp).div_ceil(8);
251
252
const WORD_SIZE: usize = 4;
253
const SWAP_CHUNK_SIZE: usize = WORD_SIZE * 2;
0 commit comments