mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Add more doc-links in docstrings (#1419)
This commit is contained in:
@@ -54,7 +54,7 @@ impl CubicBezierShape {
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert the cubic Bézier curve to one or two `PathShapes`.
|
||||
/// Convert the cubic Bézier curve to one or two [`PathShape`]'s.
|
||||
/// When the curve is closed and it has to intersect with the base line, it will be converted into two shapes.
|
||||
/// Otherwise, it will be converted into one shape.
|
||||
/// The `tolerance` will be used to control the max distance between the curve and the base line.
|
||||
@@ -418,7 +418,7 @@ impl QuadraticBezierShape {
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert the quadratic Bézier curve to one `PathShape`.
|
||||
/// Convert the quadratic Bézier curve to one [`PathShape`].
|
||||
/// The `tolerance` will be used to control the max distance between the curve and the base line.
|
||||
pub fn to_path_shape(&self, tolerance: Option<f32>) -> PathShape {
|
||||
let points = self.flatten(tolerance);
|
||||
|
||||
@@ -60,7 +60,7 @@ impl ColorImage {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create an `Image` from flat un-multiplied RGBA data.
|
||||
/// Create a [`ColorImage`] from flat un-multiplied RGBA data.
|
||||
///
|
||||
/// This is usually what you want to use after having loaded an image file.
|
||||
///
|
||||
|
||||
@@ -645,7 +645,7 @@ fn mul_color(color: Color32, factor: f32) -> Color32 {
|
||||
|
||||
/// Converts [`Shape`]s into triangles ([`Mesh`]).
|
||||
///
|
||||
/// For performance reasons it is smart to reuse the same `Tessellator`.
|
||||
/// For performance reasons it is smart to reuse the same [`Tessellator`].
|
||||
///
|
||||
/// Se also [`tessellate_shapes`], a convenient wrapper around [`Tessellator`].
|
||||
pub struct Tessellator {
|
||||
@@ -686,7 +686,7 @@ impl Tessellator {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the `Rect` to use for culling.
|
||||
/// Set the [`Rect`] to use for culling.
|
||||
pub fn set_clip_rect(&mut self, clip_rect: Rect) {
|
||||
self.clip_rect = clip_rect;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ impl FontImpl {
|
||||
type FontIndex = usize;
|
||||
|
||||
// TODO: rename?
|
||||
/// Wrapper over multiple `FontImpl` (e.g. a primary + fallbacks for emojis)
|
||||
/// Wrapper over multiple [`FontImpl`] (e.g. a primary + fallbacks for emojis)
|
||||
pub struct Font {
|
||||
fonts: Vec<Arc<FontImpl>>,
|
||||
/// Lazily calculated.
|
||||
|
||||
@@ -658,7 +658,7 @@ struct FontImplCache {
|
||||
pixels_per_point: f32,
|
||||
ab_glyph_fonts: BTreeMap<String, (FontTweak, ab_glyph::FontArc)>,
|
||||
|
||||
/// Map font pixel sizes and names to the cached `FontImpl`.
|
||||
/// Map font pixel sizes and names to the cached [`FontImpl`].
|
||||
cache: ahash::AHashMap<(u32, String), Arc<FontImpl>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ use emath::*;
|
||||
/// );
|
||||
/// ```
|
||||
///
|
||||
/// As you can see, constructing a `LayoutJob` is currently a lot of work.
|
||||
/// As you can see, constructing a [`LayoutJob`] is currently a lot of work.
|
||||
/// It would be nice to have a helper macro for it!
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
pub struct LayoutJob {
|
||||
/// The complete text of this job, referenced by `LayoutSection`.
|
||||
/// The complete text of this job, referenced by [`LayoutSection`].
|
||||
pub text: String,
|
||||
|
||||
/// The different section, which can have different fonts, colors, etc.
|
||||
@@ -140,7 +140,7 @@ impl LayoutJob {
|
||||
self.sections.is_empty()
|
||||
}
|
||||
|
||||
/// Helper for adding a new section when building a `LayoutJob`.
|
||||
/// Helper for adding a new section when building a [`LayoutJob`].
|
||||
pub fn append(&mut self, text: &str, leading_space: f32, format: TextFormat) {
|
||||
let start = self.text.len();
|
||||
self.text += text;
|
||||
@@ -308,11 +308,11 @@ pub struct Row {
|
||||
/// The mesh, ready to be rendered.
|
||||
pub visuals: RowVisuals,
|
||||
|
||||
/// If true, this `Row` came from a paragraph ending with a `\n`.
|
||||
/// If true, this [`Row`] came from a paragraph ending with a `\n`.
|
||||
/// The `\n` itself is omitted from [`Self::glyphs`].
|
||||
/// A `\n` in the input text always creates a new `Row` below it,
|
||||
/// so that text that ends with `\n` has an empty `Row` last.
|
||||
/// This also implies that the last `Row` in a `Galley` always has `ends_with_newline == false`.
|
||||
/// A `\n` in the input text always creates a new [`Row`] below it,
|
||||
/// so that text that ends with `\n` has an empty [`Row`] last.
|
||||
/// This also implies that the last [`Row`] in a [`Galley`] always has `ends_with_newline == false`.
|
||||
pub ends_with_newline: bool,
|
||||
}
|
||||
|
||||
@@ -373,13 +373,13 @@ impl Glyph {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
impl Row {
|
||||
/// Excludes the implicit `\n` after the `Row`, if any.
|
||||
/// Excludes the implicit `\n` after the [`Row`], if any.
|
||||
#[inline]
|
||||
pub fn char_count_excluding_newline(&self) -> usize {
|
||||
self.glyphs.len()
|
||||
}
|
||||
|
||||
/// Includes the implicit `\n` after the `Row`, if any.
|
||||
/// Includes the implicit `\n` after the [`Row`], if any.
|
||||
#[inline]
|
||||
pub fn char_count_including_newline(&self) -> usize {
|
||||
self.glyphs.len() + (self.ends_with_newline as usize)
|
||||
|
||||
Reference in New Issue
Block a user