mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix the SVG renderer not representing skewed raster images (#4218)
Fix the SVG renderer not skewing raster images to fit their bounds
This commit is contained in:
@@ -1558,11 +1558,9 @@ impl Render for List<Raster<CPU>> {
|
|||||||
render.parent_tag(
|
render.parent_tag(
|
||||||
"foreignObject",
|
"foreignObject",
|
||||||
|attributes| {
|
|attributes| {
|
||||||
let mut transform_values = transform.to_scale_angle_translation();
|
|
||||||
let size = DVec2::new(image.width as f64, image.height as f64);
|
let size = DVec2::new(image.width as f64, image.height as f64);
|
||||||
transform_values.0 /= size;
|
|
||||||
|
|
||||||
let matrix = DAffine2::from_scale_angle_translation(transform_values.0, transform_values.1, transform_values.2);
|
let matrix = transform * DAffine2::from_scale(1. / size);
|
||||||
let matrix = format_transform_matrix(matrix);
|
let matrix = format_transform_matrix(matrix);
|
||||||
if !matrix.is_empty() {
|
if !matrix.is_empty() {
|
||||||
attributes.push(ATTR_TRANSFORM, matrix);
|
attributes.push(ATTR_TRANSFORM, matrix);
|
||||||
|
|||||||
Reference in New Issue
Block a user