1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Enable and fix a bunch more lints

This commit is contained in:
Emil Ernerfeldt
2022-07-11 23:08:48 +02:00
parent e76c919c7e
commit 898f4804b7
21 changed files with 65 additions and 48 deletions

View File

@@ -217,7 +217,7 @@ type FontIndex = usize;
pub struct Font {
fonts: Vec<Arc<FontImpl>>,
/// Lazily calculated.
characters: Option<std::collections::BTreeSet<char>>,
characters: Option<BTreeSet<char>>,
replacement_glyph: (FontIndex, GlyphInfo),
pixels_per_point: f32,
row_height: f32,
@@ -382,7 +382,7 @@ fn allocate_glyph(
}
});
let offset_in_pixels = vec2(bb.min.x as f32, scale_in_pixels + bb.min.y as f32);
let offset_in_pixels = vec2(bb.min.x, scale_in_pixels + bb.min.y);
let offset = offset_in_pixels / pixels_per_point + y_offset * Vec2::Y;
UvRect {
offset,

View File

@@ -104,11 +104,8 @@ impl TextureAtlas {
for dx in -hw..=hw {
for dy in -hw..=hw {
let distance_to_center = ((dx * dx + dy * dy) as f32).sqrt();
let coverage = remap_clamp(
distance_to_center,
(r as f32 - 0.5)..=(r as f32 + 0.5),
1.0..=0.0,
);
let coverage =
remap_clamp(distance_to_center, (r - 0.5)..=(r + 0.5), 1.0..=0.0);
image[((x as i32 + hw + dx) as usize, (y as i32 + hw + dy) as usize)] =
coverage;
}