mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Correctly apply transforms to vector data and strokes (#1977)
* Fix adding a layer to a transformed group * Fix assorted transform issues * Default stroke transform * Fix bench * Transform gradient * Gradient fix * Add gradient reversal buttons to Fill node in the Properties panel --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -244,7 +244,15 @@ async fn construct_layer<Data: Into<GraphicElement> + Send>(
|
||||
) -> GraphicGroup {
|
||||
let graphic_element = self.graphic_element.eval(footprint).await;
|
||||
let mut stack = self.stack.eval(footprint).await;
|
||||
stack.push(graphic_element.into());
|
||||
let mut element: GraphicElement = graphic_element.into();
|
||||
if stack.transform.matrix2.determinant() != 0. {
|
||||
*element.transform_mut() = stack.transform.inverse() * element.transform();
|
||||
} else {
|
||||
stack.clear();
|
||||
stack.transform = DAffine2::IDENTITY;
|
||||
}
|
||||
|
||||
stack.push(element);
|
||||
stack
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user