Fix tests
This commit is contained in:
parent
c3cd24dc97
commit
85ac473056
2 changed files with 16 additions and 5 deletions
|
|
@ -427,16 +427,27 @@ impl<'a> Edit for ViEditor<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
for glyph in run.glyphs.iter() {
|
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 {
|
let glyph_color = match glyph.color_opt {
|
||||||
Some(some) => some,
|
Some(some) => some,
|
||||||
None => color,
|
None => color,
|
||||||
};
|
};
|
||||||
|
|
||||||
cache.with_pixels(font_system, cache_key, glyph_color, |x, y, color| {
|
cache.with_pixels(
|
||||||
f(x_int + x, line_y as i32 + y_int + y, 1, 1, color);
|
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,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ impl LayoutGlyph {
|
||||||
self.font_size * scale,
|
self.font_size * scale,
|
||||||
(
|
(
|
||||||
(self.x + x_offset) * scale + offset.0,
|
(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
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue