Skip to content

Commit

Permalink
Merge pull request #296 from waywardmonkeys/improve-docs
Browse files Browse the repository at this point in the history
docs: Small formatting improvements.
  • Loading branch information
waywardmonkeys committed Jul 12, 2023
2 parents 4a4e58b + c1bb90b commit 1b6b08c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/bezpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ impl Shape for PathSeg {

/// The area under the curve.
///
/// We could just return 0, but this seems more useful.
/// We could just return `0`, but this seems more useful.
fn area(&self) -> f64 {
self.signed_area()
}
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn solve_quartic_inner(a: f64, b: f64, c: f64, d: f64, rescale: bool) -> Option<

/// Factor a quartic into two quadratics.
///
/// Attempt to factor a quartic equation into two quadratic equations. Returns None either if there
/// Attempt to factor a quartic equation into two quadratic equations. Returns `None` either if there
/// is overflow (in which case rescaling might succeed) or the factorization would result in
/// complex coefficients.
///
Expand Down
2 changes: 1 addition & 1 deletion src/cubicbez.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl CubicBez {
/// Approximate a cubic with a single quadratic
///
/// Returns a quadratic approximating the given cubic that maintains
/// endpoint tangents if that is within tolerance, or None otherwise.
/// endpoint tangents if that is within tolerance, or `None` otherwise.
fn try_approx_quadratic(&self, accuracy: f64) -> Option<QuadBez> {
if let Some(q1) = Line::new(self.p0, self.p1).crossing_point(Line::new(self.p2, self.p3)) {
let c1 = self.p0.lerp(q1, 2.0 / 3.0);
Expand Down
2 changes: 1 addition & 1 deletion src/fit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl CurveDist {

/// Evaluate distance to a cubic approximation.
///
/// If distance exceeds stated accuracy, can return None. Note that
/// If distance exceeds stated accuracy, can return `None`. Note that
/// `acc2` is the square of the target.
///
/// Returns the squre of the error, which is intended to be a good
Expand Down
2 changes: 1 addition & 1 deletion src/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl CubicOffset {
/// Create a new curve from Bézier segment and offset.
///
/// This method should only be used if the Bézier is smooth. Use
/// [`new_regularized`]instead to deal with a wider range of inputs.
/// [`new_regularized`] instead to deal with a wider range of inputs.
///
/// [`new_regularized`]: Self::new_regularized
pub fn new(c: CubicBez, d: f64) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions src/rounded_rect_radii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ impl RoundedRectRadii {
)
}

/// Returns true if all radius values are finite.
/// Returns `true` if all radius values are finite.
pub fn is_finite(&self) -> bool {
self.top_left.is_finite()
&& self.top_right.is_finite()
&& self.bottom_right.is_finite()
&& self.bottom_left.is_finite()
}

/// Returns true if any corner radius value is NaN.
/// Returns `true` if any corner radius value is NaN.
pub fn is_nan(&self) -> bool {
self.top_left.is_nan()
|| self.top_right.is_nan()
Expand Down
2 changes: 1 addition & 1 deletion src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct SvgArc {
}

impl BezPath {
/// Create a BezPath with segments corresponding to the sequence of
/// Create a `BezPath` with segments corresponding to the sequence of
/// `PathSeg`s
pub fn from_path_segments(segments: impl Iterator<Item = PathSeg>) -> BezPath {
let mut path_elements = Vec::new();
Expand Down

0 comments on commit 1b6b08c

Please sign in to comment.