Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jul 6, 2023
1 parent c3cd24d commit 85ac473
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions src/edit/vi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,27 @@ impl<'a> Edit for ViEditor<'a> {
}

for glyph in run.glyphs.iter() {
let (cache_key, x_int, y_int) = (glyph.cache_key, glyph.x_int, glyph.y_int);
let physical_glyph = glyph.physical((0., 0.), 1.0);

let glyph_color = match glyph.color_opt {
Some(some) => some,
None => color,
};

cache.with_pixels(font_system, cache_key, glyph_color, |x, y, color| {
f(x_int + x, line_y as i32 + y_int + y, 1, 1, color);
});
cache.with_pixels(
font_system,
physical_glyph.cache_key,
glyph_color,
|x, y, color| {
f(
physical_glyph.x + x,
line_y as i32 + physical_glyph.y + y,
1,
1,
color,
);
},
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl LayoutGlyph {
self.font_size * scale,
(
(self.x + x_offset) * scale + offset.0,
((self.y - y_offset) * scale + offset.1).trunc(), // Hinting in Y axis
libm::truncf((self.y - y_offset) * scale + offset.1), // Hinting in Y axis
),
);

Expand Down

0 comments on commit 85ac473

Please sign in to comment.