mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add gizmos for interacting with the Spiral node (#2851)
* made spiral node * number of turns in decimal and arc-angle implementation * logarithmic spiral * unified log and arc spiral into spiral node * add spiral shape in shape tool * fix min value and degree unit * make it compile * impl turns handle gizmo * chore : Refactoring PR #2851 for current code base with some fixes * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: Annonnymmousss <jatin02012006@gmail.com>
This commit is contained in:
@@ -348,7 +348,7 @@ impl<PointId: Identifier> Subpath<PointId> {
|
||||
let mut prev_in_handle = None;
|
||||
let theta_end = turns * std::f64::consts::TAU + start_angle;
|
||||
|
||||
let b = calculate_b(a, turns, outer_radius, spiral_type);
|
||||
let b = calculate_growth_factor(a, turns, outer_radius, spiral_type);
|
||||
|
||||
let mut theta = start_angle;
|
||||
while theta < theta_end {
|
||||
@@ -381,7 +381,7 @@ impl<PointId: Identifier> Subpath<PointId> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn calculate_b(a: f64, turns: f64, outer_radius: f64, spiral_type: SpiralType) -> f64 {
|
||||
pub fn calculate_growth_factor(a: f64, turns: f64, outer_radius: f64, spiral_type: SpiralType) -> f64 {
|
||||
match spiral_type {
|
||||
SpiralType::Archimedean => {
|
||||
let total_theta = turns * TAU;
|
||||
|
||||
Reference in New Issue
Block a user