Avoid wrapping to the 0th glyph variant when the 4th should be used
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
24ba47e75d
commit
9311e01271
1 changed files with 3 additions and 2 deletions
|
@ -90,11 +90,12 @@ impl SpriteCache {
|
||||||
let fonts = &self.fonts;
|
let fonts = &self.fonts;
|
||||||
let atlases = &mut self.atlases;
|
let atlases = &mut self.atlases;
|
||||||
let subpixel_variant = (
|
let subpixel_variant = (
|
||||||
(target_position.x().fract() * SUBPIXEL_VARIANTS as f32).round() as u8
|
(target_position.x().fract() * SUBPIXEL_VARIANTS as f32).floor() as u8
|
||||||
% SUBPIXEL_VARIANTS,
|
% SUBPIXEL_VARIANTS,
|
||||||
(target_position.y().fract() * SUBPIXEL_VARIANTS as f32).round() as u8
|
(target_position.y().fract() * SUBPIXEL_VARIANTS as f32).floor() as u8
|
||||||
% SUBPIXEL_VARIANTS,
|
% SUBPIXEL_VARIANTS,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.glyphs
|
self.glyphs
|
||||||
.entry(GlyphDescriptor {
|
.entry(GlyphDescriptor {
|
||||||
font_id,
|
font_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue