From e5a22395a69acbe2c2dc658f3eddf0697e3c0488 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Thu, 7 Aug 2025 18:48:56 -0400 Subject: [PATCH] Fix docs --- crates/egui/src/painter.rs | 4 ++-- crates/egui/src/ui.rs | 4 ++-- crates/egui/src/widgets/text_edit/builder.rs | 2 +- crates/epaint/src/shapes/text_shape.rs | 2 +- crates/epaint/src/text/fonts.rs | 2 +- crates/epaint/src/text/text_layout.rs | 2 +- crates/epaint/src/text/text_layout_types.rs | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/egui/src/painter.rs b/crates/egui/src/painter.rs index 814acfa7a..f121c8557 100644 --- a/crates/egui/src/painter.rs +++ b/crates/egui/src/painter.rs @@ -141,7 +141,7 @@ impl Painter { self.pixels_per_point } - /// Read-only access to the shared [`Fonts`]. + /// Read-only access to the shared [`FontsView`]. /// /// See [`Context`] documentation for how locks work. #[inline] @@ -149,7 +149,7 @@ impl Painter { self.ctx.fonts(reader) } - /// Read-write access to the shared [`Fonts`]. + /// Read-write access to the shared [`FontsView`]. /// /// See [`Context`] documentation for how locks work. #[inline] diff --git a/crates/egui/src/ui.rs b/crates/egui/src/ui.rs index fd08a99f8..357e13530 100644 --- a/crates/egui/src/ui.rs +++ b/crates/egui/src/ui.rs @@ -846,13 +846,13 @@ impl Ui { self.ctx().output_mut(writer) } - /// Read-only access to [`Fonts`]. + /// Read-only access to [`FontsView`]. #[inline] pub fn fonts(&self, reader: impl FnOnce(&FontsView<'_>) -> R) -> R { self.ctx().fonts(reader) } - /// Read-write access to [`Fonts`]. + /// Read-write access to [`FontsView`]. #[inline] pub fn fonts_mut(&self, reader: impl FnOnce(&mut FontsView<'_>) -> R) -> R { self.ctx().fonts_mut(reader) diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index fa8cffe96..20cd079b0 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -266,7 +266,7 @@ impl<'t> TextEdit<'t> { /// let mut layouter = |ui: &egui::Ui, buf: &dyn egui::TextBuffer, wrap_width: f32| { /// let mut layout_job: egui::text::LayoutJob = my_memoized_highlighter(buf.as_str()); /// layout_job.wrap.max_width = wrap_width; - /// ui.fonts(|f| f.layout_job(layout_job)) + /// ui.fonts_mut(|f| f.layout_job(layout_job)) /// }; /// ui.add(egui::TextEdit::multiline(&mut my_code).layouter(&mut layouter)); /// # }); diff --git a/crates/epaint/src/shapes/text_shape.rs b/crates/epaint/src/shapes/text_shape.rs index 9fe98f211..349707eac 100644 --- a/crates/epaint/src/shapes/text_shape.rs +++ b/crates/epaint/src/shapes/text_shape.rs @@ -15,7 +15,7 @@ pub struct TextShape { /// Usually the top left corner of the first character. pub pos: Pos2, - /// The laid out text, from [`Fonts::layout_job`]. + /// The laid out text, from [`FontsView::layout_job`]. pub galley: Arc, /// Add this underline to the whole text. diff --git a/crates/epaint/src/text/fonts.rs b/crates/epaint/src/text/fonts.rs index 816e4afa4..1c286c5db 100644 --- a/crates/epaint/src/text/fonts.rs +++ b/crates/epaint/src/text/fonts.rs @@ -700,7 +700,7 @@ impl FontsView<'_> { /// How full is the font atlas? /// /// This increases as new fonts and/or glyphs are used, - /// but can also decrease in a call to [`Self::begin_pass`]. + /// but can also decrease in a call to [`Fonts::begin_pass`]. pub fn font_atlas_fill_ratio(&self) -> f32 { self.fonts.atlas.fill_ratio() } diff --git a/crates/epaint/src/text/text_layout.rs b/crates/epaint/src/text/text_layout.rs index a207e7252..1c478ffa3 100644 --- a/crates/epaint/src/text/text_layout.rs +++ b/crates/epaint/src/text/text_layout.rs @@ -66,7 +66,7 @@ impl Paragraph { /// Layout text into a [`Galley`]. /// -/// In most cases you should use [`crate::Fonts::layout_job`] instead +/// In most cases you should use [`crate::FontsView::layout_job`] instead /// since that memoizes the input, making subsequent layouting of the same text much faster. pub fn layout(fonts: &mut FontsImpl, job: Arc, pixels_per_point: f32) -> Galley { profiling::function_scope!(); diff --git a/crates/epaint/src/text/text_layout_types.rs b/crates/epaint/src/text/text_layout_types.rs index d88e3f8bf..e6a0c6607 100644 --- a/crates/epaint/src/text/text_layout_types.rs +++ b/crates/epaint/src/text/text_layout_types.rs @@ -15,7 +15,7 @@ use emath::{Align, GuiRounding as _, NumExt as _, OrderedFloat, Pos2, Rect, Vec2 /// /// This supports mixing different fonts, color and formats (underline etc). /// -/// Pass this to [`crate::Fonts::layout_job`] or [`crate::text::layout`]. +/// Pass this to [`crate::FontsView::layout_job`] or [`crate::text::layout`]. /// /// ## Example: /// ``` @@ -504,7 +504,7 @@ impl TextWrapping { /// Text that has been laid out, ready for painting. /// -/// You can create a [`Galley`] using [`crate::Fonts::layout_job`]; +/// You can create a [`Galley`] using [`crate::FontsView::layout_job`]; /// /// Needs to be recreated if the underlying font atlas texture changes, which /// happens under the following conditions: