Make the Transform node use angles in degrees instead of radians for Rotation and Skew (#3160)

* Make the Transform node use degrees not radians

* Migration script

* Migrate skew value input to store degrees

* Add comments

* Fix migrations to account for the old deprecated "Pivot" parameter

* Fix tooling interactions with degrees-based transforms

* Upgrade demo art

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Adam Gerhant
2025-09-10 17:19:10 -07:00
committed by GitHub
parent c51967384f
commit 332088bce1
14 changed files with 143 additions and 38 deletions

View File

@@ -22,12 +22,14 @@ async fn transform<T: ApplyTransform + 'n + 'static>(
Context -> Table<GradientStops>,
)]
value: impl Node<Context<'static>, Output = T>,
translate: DVec2,
rotate: f64,
translation: DVec2,
rotation: f64,
scale: DVec2,
skew: DVec2,
) -> T {
let matrix = DAffine2::from_scale_angle_translation(scale, rotate, translate) * DAffine2::from_cols_array(&[1., skew.y, skew.x, 1., 0., 0.]);
let trs = DAffine2::from_scale_angle_translation(scale, rotation.to_radians(), translation);
let skew = DAffine2::from_cols_array(&[1., skew.y.to_radians().tan(), skew.x.to_radians().tan(), 1., 0., 0.]);
let matrix = trs * skew;
let footprint = ctx.try_footprint().copied();