Skip to content

Commit

Permalink
Fixed failing unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed May 27, 2024
1 parent 789d902 commit 7ea9ca1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/icy_engine/src/editor/area_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ fn generate_flipx_variants(cur_glyph: &crate::Glyph, font_width: i32) -> Option<
let w = 8 - font_width;

for i in 0..flipped_glyph.data.len() {
flipped_glyph.data[i] = flipped_glyph.data[i].reverse_bits() << w;
flipped_glyph.data[i] = ((flipped_glyph.data[i] as u8).reverse_bits() << w) as u32;
}
if cur_glyph.data == flipped_glyph.data {
return None;
Expand All @@ -488,21 +488,25 @@ fn generate_x_variants(flipped_glyph: &crate::Glyph, _font_width: i32) -> Vec<cr
let mut left_glyph = cmp_glyhps[0].clone();
for i in 0..left_glyph.data.len() {
left_glyph.data[i] <<= 1;
left_glyph.data[i] &= 0xFF;
}
let mut left_by2_glyph = left_glyph.clone();
for i in 0..left_glyph.data.len() {
left_by2_glyph.data[i] <<= 1;
left_by2_glyph.data[i] &= 0xFF;
}
cmp_glyhps.push(left_glyph);
cmp_glyhps.push(left_by2_glyph);

let mut right_glyph = cmp_glyhps[0].clone();
for i in 0..right_glyph.data.len() {
right_glyph.data[i] >>= 1;
right_glyph.data[i] &= 0xFF;
}
let mut right_by2_glyph = right_glyph.clone();
for i in 0..right_glyph.data.len() {
right_by2_glyph.data[i] >>= 1;
right_by2_glyph.data[i] &= 0xFF;
}
cmp_glyhps.push(right_glyph);
cmp_glyhps.push(right_by2_glyph);
Expand Down

0 comments on commit 7ea9ca1

Please sign in to comment.