Refactor transform decomposition API with skew support, add 'Decompose Skew' node, and fix stroke transform interpolation (#3973)

* Refactor transform decomposition API with skew support, add Decompose Skew node, and fix stroke transform interpolation

* Fix bug in master with skew changing Area node calculated value

* Code review simplification

* More code review fixes

* Rename cases where "shear" terminology was used in place of "skew"
This commit is contained in:
Keavon Chambers
2026-03-28 20:47:32 -07:00
committed by GitHub
parent e2a142333f
commit a3ea6ab0af
15 changed files with 160 additions and 70 deletions

View File

@@ -4,7 +4,7 @@ use core::hash::{Hash, Hasher};
use core_types::bounds::{BoundingBox, RenderBoundingBox};
use core_types::registry::types::{Angle, Length, Multiplier, Percentage, PixelLength, Progression, SeedValue};
use core_types::table::{Table, TableRow, TableRowMut};
use core_types::transform::{Footprint, Transform};
use core_types::transform::Footprint;
use core_types::{CloneVarArgs, Color, Context, Ctx, ExtractAll, OwnedContextImpl};
use glam::{DAffine2, DVec2};
use graphic_types::Vector;
@@ -2534,8 +2534,8 @@ async fn area(ctx: impl Ctx + CloneVarArgs + ExtractAll, content: impl Node<Cont
vector
.iter()
.map(|row| {
let scale = row.transform.decompose_scale();
row.element.stroke_bezpath_iter().map(|subpath| subpath.area() * scale.x * scale.y).sum::<f64>()
let area_scale = row.transform.matrix2.determinant().abs();
row.element.stroke_bezpath_iter().map(|subpath| subpath.area() * area_scale).sum::<f64>()
})
.sum()
}