Lint
This commit is contained in:
1 parent
aa1bfb768e
commit
20a1db073d
20 files changed
+118
-126
No files matched your search
+6
-4
@@ -210,10 +210,12 @@ impl FontAtlas {
|
||||
let a = image.data[i];
|
||||
// SAFETY: allocated atlas region and swash image have the same size
|
||||
unsafe {
|
||||
allocation
|
||||
.sub_image
|
||||
.unsafe_put_pixel(x, y, Srgba::new(255, 255, 255, a).into())
|
||||
};
|
||||
allocation.sub_image.unsafe_put_pixel(
|
||||
x,
|
||||
y,
|
||||
Srgba::new(255, 255, 255, a).into(),
|
||||
);
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -14,7 +14,7 @@ pub type LayoutRect<T> = Rect<T, LayoutSpace>;
|
||||
|
||||
pub type LayoutToLogical = Translation<f32, LayoutSpace, LogicalScreenSpace>;
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, Hash, PartialEq)]
|
||||
#[derive(Copy, Clone, Default, Debug, Hash, Eq, PartialEq)]
|
||||
pub enum Alignment {
|
||||
#[default]
|
||||
Min,
|
||||
@@ -22,7 +22,7 @@ pub enum Alignment {
|
||||
Max,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, Hash, PartialEq)]
|
||||
#[derive(Copy, Clone, Default, Debug, Hash, Eq, PartialEq)]
|
||||
pub enum FontStyle {
|
||||
#[default]
|
||||
Normal,
|
||||
@@ -32,8 +32,8 @@ pub enum FontStyle {
|
||||
impl From<FontStyle> for parley::FontStyle {
|
||||
fn from(value: FontStyle) -> Self {
|
||||
match value {
|
||||
FontStyle::Normal => parley::FontStyle::Normal,
|
||||
FontStyle::Italic => parley::FontStyle::Italic,
|
||||
FontStyle::Normal => Self::Normal,
|
||||
FontStyle::Italic => Self::Italic,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ impl GlyphRasterizer {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
scale_context: swash::scale::ScaleContext::new(),
|
||||
swash_keys: Default::default(),
|
||||
style_cache: Default::default(),
|
||||
cached_glyphs: Default::default(),
|
||||
scratch: Default::default(),
|
||||
swash_keys: HashMap::default(),
|
||||
style_cache: StyleCache::default(),
|
||||
cached_glyphs: HashMap::default(),
|
||||
scratch: swash::scale::image::Image::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ fn rasterize_glyph(
|
||||
|
||||
if !did_render || image.placement.width == 0 || image.placement.height == 0 {
|
||||
return None;
|
||||
};
|
||||
}
|
||||
|
||||
let (size, uv, layer_idx) = atlas.write_mask(image);
|
||||
|
||||
|
||||
Reference in new issue
Block a user