mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-05 23:18:11 +08:00
Restore the sample_polyline test attribute and drop dead scaffolding
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
use glam::{DAffine2, DVec2, IVec2};
|
use glam::{DAffine2, DVec2, IVec2};
|
||||||
use graphene_std::gradient::GradientStops;
|
use graphene_std::gradient::GradientStops;
|
||||||
use graphene_std::list::{AttributeDyn, AttributeValueDyn, List, ListDyn};
|
use graphene_std::list::{AttributeDyn, AttributeValueDyn, List, ListDyn};
|
||||||
#[cfg(target_family = "wasm")]
|
|
||||||
use graphene_std::platform_application_io::canvas_utils::CanvasHandle;
|
|
||||||
#[cfg(feature = "gpu")]
|
#[cfg(feature = "gpu")]
|
||||||
use graphene_std::raster::GPU;
|
use graphene_std::raster::GPU;
|
||||||
use graphene_std::raster::color::Color;
|
use graphene_std::raster::color::Color;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ fn repeat_on_points<T: Into<Graphic> + Default + Send + Clone + 'static>(
|
|||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use core_types::arena::Arena;
|
use core_types::arena::Arena;
|
||||||
use core_types::context::{ContextImpl, EvalScope, ExtractIndex, ExtractPosition};
|
use core_types::context::{ContextImpl, EvalScope, ExtractPosition};
|
||||||
use core_types::gpoll::GPoll;
|
use core_types::gpoll::GPoll;
|
||||||
use core_types::list::Item;
|
use core_types::list::Item;
|
||||||
use core_types::node::{Node, StatusCell};
|
use core_types::node::{Node, StatusCell};
|
||||||
@@ -206,20 +206,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns one default `Vector` whose transform records the innermost context index in its x translation.
|
|
||||||
struct IndexProbe;
|
|
||||||
|
|
||||||
impl<Input: ExtractIndex> Node<Input> for IndexProbe {
|
|
||||||
type Output = List<Vector>;
|
|
||||||
|
|
||||||
fn eval(&self, input: &Input) -> GPoll<List<Vector>> {
|
|
||||||
let index = input.try_index().and_then(|mut levels| levels.next()).expect("repeat must push an index level");
|
|
||||||
let mut list = List::new();
|
|
||||||
list.push(Item::new_from_element(Vector::default()).with_attribute(ATTR_TRANSFORM, DAffine2::from_translation(DVec2::new(index as f64, 0.))));
|
|
||||||
GPoll::Final(list)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns one default `Vector` recording the innermost context position under `TEST_POSITION`.
|
/// Returns one default `Vector` recording the innermost context position under `TEST_POSITION`.
|
||||||
struct PositionProbe;
|
struct PositionProbe;
|
||||||
|
|
||||||
|
|||||||
@@ -3702,6 +3702,7 @@ mod test {
|
|||||||
assert_eq!(manipulator_groups_anchors[i], expected_bounding_box[i]);
|
assert_eq!(manipulator_groups_anchors[i], expected_bounding_box[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[test]
|
||||||
fn sample_polyline() {
|
fn sample_polyline() {
|
||||||
let path = BezPath::from_vec(vec![PathEl::MoveTo(Point::ZERO), PathEl::CurveTo(Point::ZERO, Point::new(100., 0.), Point::new(100., 0.))]);
|
let path = BezPath::from_vec(vec![PathEl::MoveTo(Point::ZERO), PathEl::CurveTo(Point::ZERO, Point::new(100., 0.), Point::new(100., 0.))]);
|
||||||
let (sample_polyline, _) = super::sample_polyline(&Footprint::default(), (Vector::from_bezpath(path), Attr(DAffine2::IDENTITY)), PointSpacingType::Separation, 30., 0, 0., 0., false);
|
let (sample_polyline, _) = super::sample_polyline(&Footprint::default(), (Vector::from_bezpath(path), Attr(DAffine2::IDENTITY)), PointSpacingType::Separation, 30., 0, 0., 0., false);
|
||||||
|
|||||||
Reference in New Issue
Block a user