mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-29 10:48:12 +08:00
Fix gradient transformation (#588)
* Fix with perfect circle * Actually fix rotated gradient * Gradient transform & fix on rotated canvas * Cleanup & remove logging
This commit is contained in:
committed by
Keavon Chambers
parent
9c61fbc936
commit
ca28bc3947
@@ -63,9 +63,20 @@ impl LayerData for TextLayer {
|
||||
} else {
|
||||
let mut path = self.to_bez_path();
|
||||
|
||||
let kurbo::Rect { x0, y0, x1, y1 } = path.bounding_box();
|
||||
let bounds = [(x0, y0).into(), (x1, y1).into()];
|
||||
|
||||
path.apply_affine(glam_to_kurbo(transform));
|
||||
|
||||
let _ = write!(svg, r#"<path d="{}" {} />"#, path.to_svg(), self.style.render(view_mode, svg_defs));
|
||||
let kurbo::Rect { x0, y0, x1, y1 } = path.bounding_box();
|
||||
let transformed_bounds = [(x0, y0).into(), (x1, y1).into()];
|
||||
|
||||
let _ = write!(
|
||||
svg,
|
||||
r#"<path d="{}" {} />"#,
|
||||
path.to_svg(),
|
||||
self.style.render(view_mode, svg_defs, transform, bounds, transformed_bounds)
|
||||
);
|
||||
}
|
||||
let _ = svg.write_str("</g>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user