Skip to content

Commit 271f299

Browse files
Fix doc errors.
1 parent f2bbc50 commit 271f299

File tree

2 files changed

+17
-14
lines changed
  • crates

2 files changed

+17
-14
lines changed

crates/bevy_math/src/primitives/dim2.rs

+15-12
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ impl Circle {
180180
///
181181
/// An arc has no area.
182182
/// If you want to include the portion of a circle's area swept out by the arc,
183-
/// use [CircularSector].
183+
/// use [`CircularSector`].
184+
/// If you want to include only the space inside the convex hull of the arc,
185+
/// use [`CircularSegment`].
184186
///
185-
/// The arc is drawn starting from [Vec2::X], going counterclockwise.
187+
/// The arc is drawn starting from [`Vec2::X`], going counterclockwise.
186188
/// To orient the arc differently, apply a rotation.
187189
/// The arc is drawn with the center of its circle at the origin (0, 0),
188190
/// meaning that the center may not be inside its convex hull.
@@ -197,7 +199,7 @@ pub struct Arc {
197199
impl Primitive2d for Arc {}
198200

199201
impl Default for Arc {
200-
// Returns the default [`Arc`] with radius `0.5` and angle `1.0`.
202+
/// Returns the default [`Arc`] with radius `0.5` and angle `1.0`.
201203
fn default() -> Self {
202204
Self {
203205
radius: 0.5,
@@ -282,8 +284,9 @@ impl Arc {
282284
/// the length of the line between the midpoints of the arc and its chord.
283285
/// Equivalently, the height of the triangle whose base is the chord and whose apex is the midpoint of the arc.
284286
///
285-
/// If the arc is minor, i.e. less than half the circle, the this will be the difference of the [radius](Self::radius) and the [apothem](Self::apothem).
286-
/// If it is [major](Self::major), it will be their sum.
287+
/// If the arc is minor, i.e. less than half the circle, the this will be the difference of the [`radius`](Self::radius)
288+
/// and the [`apothem`](Self::apothem_len).
289+
/// If the arc is [major](Self::is_major), it will be their sum.
287290
#[inline(always)]
288291
pub fn sagitta_len(&self) -> f32 {
289292
if self.is_major() {
@@ -302,7 +305,7 @@ impl Arc {
302305

303306
/// A primitive representing a circular sector: a pie slice of a circle.
304307
///
305-
/// The sector is drawn starting from [Vec2::X], going counterclockwise.
308+
/// The sector is drawn starting from [`Vec2::X`], going counterclockwise.
306309
/// To orient the sector differently, apply a rotation.
307310
/// The sector is drawn with the center of its circle at the origin (0, 0).
308311
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -315,7 +318,7 @@ pub struct CircularSector {
315318
impl Primitive2d for CircularSector {}
316319

317320
impl Default for CircularSector {
318-
// Returns the default [`CircularSector`] with radius `0.5` and angle `1.0`.
321+
/// Returns the default [`CircularSector`] with radius `0.5` and angle `1.0`.
319322
fn default() -> Self {
320323
Arc::default().into()
321324
}
@@ -328,7 +331,7 @@ impl From<Arc> for CircularSector {
328331
}
329332

330333
impl CircularSector {
331-
/// Create a new [CircularSector] from a `radius`, and an `angle`
334+
/// Create a new [`CircularSector`] from a `radius`, and an `angle`
332335
#[inline(always)]
333336
pub fn new(radius: f32, angle: f32) -> Self {
334337
Arc::new(radius, angle).into()
@@ -344,10 +347,10 @@ impl CircularSector {
344347
/// A primitive representing a circular segment:
345348
/// the area enclosed by the arc of a circle and its chord (the line between its endpoints).
346349
///
347-
/// The segment is drawn starting from [Vec2::X], going counterclockwise.
350+
/// The segment is drawn starting from [`Vec2::X`], going counterclockwise.
348351
/// To orient the segment differently, apply a rotation.
349352
/// The segment is drawn with the center of its circle at the origin (0, 0).
350-
/// When positioning the segment, the [apothem_len](Self::apothem) and [sagitta_len](Sagitta) functions
353+
/// When positioning the segment, the [`apothem_len`](Arc::apothem_len) and [`sagitta_len`](Arc::sagitta_len) functions
351354
/// may be particularly useful.
352355
#[derive(Clone, Copy, Debug, PartialEq)]
353356
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
@@ -359,7 +362,7 @@ pub struct CircularSegment {
359362
impl Primitive2d for CircularSegment {}
360363

361364
impl Default for CircularSegment {
362-
// Returns the default [CircularSegment] with radius `0.5` and angle `1.0`.
365+
/// Returns the default [`CircularSegment`] with radius `0.5` and angle `1.0`.
363366
fn default() -> Self {
364367
Arc::default().into()
365368
}
@@ -372,7 +375,7 @@ impl From<Arc> for CircularSegment {
372375
}
373376

374377
impl CircularSegment {
375-
/// Create a new [CircularSegment] from a `radius`, and an `angle`
378+
/// Create a new [`CircularSegment`] from a `radius`, and an `angle`
376379
#[inline(always)]
377380
pub fn new(radius: f32, angle: f32) -> Self {
378381
Arc::new(radius, angle).into()

crates/bevy_render/src/mesh/primitives/dim2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl From<CircleMeshBuilder> for Mesh {
8383
/// A builder used for creating a [`Mesh`] with a [`CircularSector`] shape.
8484
#[derive(Clone, Copy, Debug)]
8585
pub struct CircularSectorMeshBuilder {
86-
/// The [`sector`] shape.
86+
/// The sector shape.
8787
pub sector: CircularSector,
8888
/// The number of vertices used for the arc portion of the sector mesh.
8989
/// The default is `32`.
@@ -184,7 +184,7 @@ impl From<CircularSectorMeshBuilder> for Mesh {
184184
/// A builder used for creating a [`Mesh`] with a [`CircularSegment`] shape.
185185
#[derive(Clone, Copy, Debug)]
186186
pub struct CircularSegmentMeshBuilder {
187-
/// The [`segment`] shape.
187+
/// The segment shape.
188188
pub segment: CircularSegment,
189189
/// The number of vertices used for the arc portion of the segment mesh.
190190
/// The default is `32`.

0 commit comments

Comments
 (0)