mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 19:08:05 +08:00
Remove the deprecated/archived Bezier-rs library from the repo (#3058)
Remove the Bezier-rs library from the repo
This commit is contained in:
@@ -864,7 +864,7 @@ async fn offset_path(_: impl Ctx, content: Table<Vector>, distance: f64, join: S
|
||||
for mut bezpath in bezpaths {
|
||||
bezpath.apply_affine(transform);
|
||||
|
||||
// Taking the existing stroke data and passing it to Bezier-rs to generate new paths.
|
||||
// Taking the existing stroke data and passing it to Kurbo to generate new paths.
|
||||
let mut bezpath_out = offset_bezpath(
|
||||
&bezpath,
|
||||
-distance,
|
||||
|
||||
@@ -59,7 +59,7 @@ impl std::hash::Hash for Vector {
|
||||
}
|
||||
|
||||
impl Vector {
|
||||
/// Add a Bezier-rs subpath to this path.
|
||||
/// Add a subpath to this vector path.
|
||||
pub fn append_subpath(&mut self, subpath: impl Borrow<Subpath<PointId>>, preserve_id: bool) {
|
||||
let subpath: &Subpath<PointId> = subpath.borrow();
|
||||
let stroke_id = StrokeId::ZERO;
|
||||
@@ -131,7 +131,7 @@ impl Vector {
|
||||
self.point_domain.push(id, point.position);
|
||||
}
|
||||
|
||||
/// Construct some new vector path from a single Bezier-rs subpath with an identity transform and black fill.
|
||||
/// Construct some new vector path from a single subpath with an identity transform and black fill.
|
||||
pub fn from_subpath(subpath: impl Borrow<Subpath<PointId>>) -> Self {
|
||||
Self::from_subpaths([subpath], false)
|
||||
}
|
||||
@@ -143,7 +143,7 @@ impl Vector {
|
||||
vector
|
||||
}
|
||||
|
||||
/// Construct some new vector path from Bezier-rs subpaths with an identity transform and black fill.
|
||||
/// Construct some new vector path from subpaths with an identity transform and black fill.
|
||||
pub fn from_subpaths(subpaths: impl IntoIterator<Item = impl Borrow<Subpath<PointId>>>, preserve_id: bool) -> Self {
|
||||
let mut vector = Self::default();
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
//! requires bezier-rs
|
||||
|
||||
use crate::curve::{Curve, CurveManipulatorGroup, ValueMapperNode};
|
||||
use graphene_core::color::{Channel, Linear};
|
||||
use graphene_core::context::Ctx;
|
||||
@@ -34,7 +32,7 @@ fn generate_curves<C: Channel + Linear>(_: impl Ctx, curve: Curve, #[implementat
|
||||
pathseg_find_tvalues_for_x(segment, x)
|
||||
.next()
|
||||
.map(|t| segment.eval(t.clamp(0., 1.)).y)
|
||||
// Fall back to a very bad approximation if Bezier-rs fails
|
||||
// Fall back to a very bad approximation if the above fails
|
||||
.unwrap_or_else(|| (x - x0) / (x3 - x0) * (y3 - y0) + y0)
|
||||
};
|
||||
lut[index] = C::from_f64(y);
|
||||
|
||||
Reference in New Issue
Block a user