Use f64 not f32 throughout graph; add Vector2 value node (#1618)

* Use doubles in graph

* Format .graphite files onto one line

* Rename new node to Vector2

* No primary input

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2024-02-18 22:16:37 +00:00
committed by GitHub
parent 0e0e347435
commit 229b5dbb20
24 changed files with 477 additions and 445 deletions

View File

@@ -236,7 +236,7 @@ pub(crate) async fn transform_vector_data<Fut: Future>(
mut footprint: Footprint,
transform_target: impl Node<Footprint, Output = Fut>,
translate: DVec2,
rotate: f32,
rotate: f64,
scale: DVec2,
shear: DVec2,
pivot: DVec2,
@@ -245,7 +245,7 @@ where
Fut::Output: TransformMut,
{
// TODO: This is hack and might break for Vector data because the pivot may be incorrect
let transform = DAffine2::from_scale_angle_translation(scale, rotate as f64, translate) * DAffine2::from_cols_array(&[1., shear.y, shear.x, 1., 0., 0.]);
let transform = DAffine2::from_scale_angle_translation(scale, rotate, translate) * DAffine2::from_cols_array(&[1., shear.y, shear.x, 1., 0., 0.]);
if !footprint.ignore_modifications {
let pivot_transform = DAffine2::from_translation(pivot);
let modification = pivot_transform * transform * pivot_transform.inverse();