Skip to content

Commit e949231

Browse files
committed
Cargo fmt, rename fonts to font_cache
1 parent 1085982 commit e949231

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

internal/core/textlayout/sharedparley.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn layout(text: &str, scale_factor: f32, options: LayoutOptions) -> Layout {
110110
}
111111

112112
let max_physical_width = options.max_physical_width.map(|max_width| max_width.get());
113-
113+
114114
let mut layout: parley::Layout<Brush> = builder.build(text);
115115
layout.break_all_lines(max_physical_width);
116116
layout.align(
File renamed without changes.

internal/renderers/femtovg/itemrenderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::images::TextureImporter;
3030

3131
use super::images::{Texture, TextureCacheKey};
3232
use super::PhysicalSize;
33-
use super::{fonts, PhysicalBorderRadius, PhysicalLength, PhysicalPoint, PhysicalRect};
33+
use super::{font_cache, PhysicalBorderRadius, PhysicalLength, PhysicalPoint, PhysicalRect};
3434

3535
type FemtovgBoxShadowCache<R> = BoxShadowCache<ItemGraphicsCacheEntry<R>>;
3636

@@ -209,7 +209,7 @@ fn draw_glyphs<R: femtovg::Renderer + TextureImporter>(
209209
let run = glyph_run.run();
210210

211211
let font_id =
212-
fonts::FONT_CACHE.with(|cache| cache.borrow_mut().font(run.font()));
212+
font_cache::FONT_CACHE.with(|cache| cache.borrow_mut().font(run.font()));
213213

214214
let brush = glyph_run.style().brush;
215215

internal/renderers/femtovg/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type PhysicalBorderRadius = BorderRadius<f32, PhysicalPx>;
3434

3535
use self::itemrenderer::CanvasRc;
3636

37-
mod fonts;
37+
mod font_cache;
3838
mod images;
3939
mod itemrenderer;
4040
#[cfg(feature = "opengl")]
@@ -345,11 +345,8 @@ impl<B: GraphicsBackend> RendererSealed for FemtoVGRenderer<B> {
345345
..Default::default()
346346
},
347347
);
348-
let cursor = parley::layout::cursor::Cursor::from_point(
349-
&layout,
350-
pos.x,
351-
pos.y - layout.y_offset,
352-
);
348+
let cursor =
349+
parley::layout::cursor::Cursor::from_point(&layout, pos.x, pos.y - layout.y_offset);
353350

354351
let visual_representation = text_input.visual_representation(None);
355352
visual_representation.map_byte_offset_from_byte_offset_in_visual_text(cursor.index())

internal/renderers/femtovg/opengl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl OpenGLBackend {
137137

138138
let femtovg_canvas = femtovg::Canvas::new_with_text_context(
139139
gl_renderer,
140-
crate::fonts::FONT_CACHE.with(|cache| cache.borrow().text_context.clone()),
140+
crate::font_cache::FONT_CACHE.with(|cache| cache.borrow().text_context.clone()),
141141
)
142142
.unwrap();
143143

0 commit comments

Comments
 (0)