You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let intersection = if gradient.start.x == gradient.end.x{
524
+
DVec2::new(0.,100.)
525
+
}else{
526
+
let slope = (gradient.start.y - gradient.end.y) / (gradient.start.x - gradient.end.x);
527
+
if slope > 100. / 150.{DVec2::new(100. / slope,100.)}else{DVec2::new(150., slope *150.)}
528
+
};
529
+
gradient.start = (0.,0.).into();
530
+
gradient.end = intersection;
531
+
rectangle.style.fill = Fill::Gradient(gradient);
532
+
Instances::new(rectangle)
533
+
}
534
+
GradientType::Radial => {
535
+
letmut circle = VectorData::from_subpath(Subpath::new_ellipse((-100., -100.).into(),(100.,100.).into()));
536
+
gradient.start = (0.,0.).into();
537
+
gradient.end = (100.,0.).into();
538
+
gradient.transform = DAffine2::IDENTITY;
539
+
circle.style.fill = Fill::Gradient(gradient);
540
+
Instances::new(circle)
541
+
}
542
+
}
543
+
}
544
+
}
545
+
514
546
/// A selectable part of a curve, either an anchor (start or end of a bézier) or a handle (doesn't necessarily go through the bézier but influences curvature).
0 commit comments