1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Add more doc-links in docstrings (#1419)

This commit is contained in:
4JX
2022-04-03 18:18:35 +02:00
committed by GitHub
parent 861b0e11ba
commit 6091370962
60 changed files with 257 additions and 257 deletions

View File

@@ -231,7 +231,7 @@ fn test_remap() {
// ----------------------------------------------------------------------------
/// Extends `f32`, `Vec2` etc with `at_least` and `at_most` as aliases for `max` and `min`.
/// Extends `f32`, [`Vec2`] etc with `at_least` and `at_most` as aliases for `max` and `min`.
pub trait NumExt {
/// More readable version of `self.max(lower_limit)`
fn at_least(self, lower_limit: Self) -> Self;

View File

@@ -5,7 +5,7 @@ use crate::*;
/// A rectangular region of space.
///
/// Usually a `Rect` has a positive (or zero) size,
/// Usually a [`Rect`] has a positive (or zero) size,
/// and then [`Self::min`] `<=` [`Self::max`].
/// In these cases [`Self::min`] is the left-top corner
/// and [`Self::max`] is the right-bottom corner.
@@ -53,7 +53,7 @@ impl Rect {
max: pos2(-INFINITY, -INFINITY),
};
/// An invalid `Rect` filled with [`f32::NAN`];
/// An invalid [`Rect`] filled with [`f32::NAN`];
pub const NAN: Self = Self {
min: pos2(f32::NAN, f32::NAN),
max: pos2(f32::NAN, f32::NAN),
@@ -107,7 +107,7 @@ impl Rect {
rect
}
/// A `Rect` that contains every point to the right of the given X coordinate.
/// A [`Rect`] that contains every point to the right of the given X coordinate.
#[inline]
pub fn everything_right_of(left_x: f32) -> Self {
let mut rect = Self::EVERYTHING;
@@ -115,7 +115,7 @@ impl Rect {
rect
}
/// A `Rect` that contains every point to the left of the given X coordinate.
/// A [`Rect`] that contains every point to the left of the given X coordinate.
#[inline]
pub fn everything_left_of(right_x: f32) -> Self {
let mut rect = Self::EVERYTHING;
@@ -123,7 +123,7 @@ impl Rect {
rect
}
/// A `Rect` that contains every point below a certain y coordinate
/// A [`Rect`] that contains every point below a certain y coordinate
#[inline]
pub fn everything_below(top_y: f32) -> Self {
let mut rect = Self::EVERYTHING;
@@ -131,7 +131,7 @@ impl Rect {
rect
}
/// A `Rect` that contains every point above a certain y coordinate
/// A [`Rect`] that contains every point above a certain y coordinate
#[inline]
pub fn everything_above(bottom_y: f32) -> Self {
let mut rect = Self::EVERYTHING;
@@ -169,7 +169,7 @@ impl Rect {
Rect::from_min_size(self.min + amnt, self.size())
}
/// Rotate the bounds (will expand the `Rect`)
/// Rotate the bounds (will expand the [`Rect`])
#[must_use]
#[inline]
pub fn rotate_bb(self, rot: crate::Rot2) -> Self {
@@ -246,7 +246,7 @@ impl Rect {
self.max.y = self.max.y.max(y);
}
/// The union of two bounding rectangle, i.e. the minimum `Rect`
/// The union of two bounding rectangle, i.e. the minimum [`Rect`]
/// that contains both input rectangles.
#[inline(always)]
#[must_use]
@@ -257,7 +257,7 @@ impl Rect {
}
}
/// The intersection of two `Rect`, i.e. the area covered by both.
/// The intersection of two [`Rect`], i.e. the area covered by both.
#[inline]
#[must_use]
pub fn intersect(self, other: Rect) -> Self {

View File

@@ -2,7 +2,7 @@ use crate::*;
/// Linearly transforms positions from one [`Rect`] to another.
///
/// `RectTransform` stores the rectangles, and therefore supports clamping and culling.
/// [`RectTransform`] stores the rectangles, and therefore supports clamping and culling.
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]

View File

@@ -11,7 +11,7 @@ use super::Vec2;
//
/// A rotation of 𝞃/4 = 90° rotates the X axis to the Y axis.
//
/// Normally a `Rot2` is normalized (unit-length).
/// Normally a [`Rot2`] is normalized (unit-length).
/// If not, it will also scale vectors.
#[repr(C)]
#[derive(Clone, Copy, PartialEq)]