Apply aspect ratio correction for linear gradients in PDF export (#6689)
This commit is contained in:
parent
0fe8f09ba9
commit
2809dac6a7
|
|
@ -152,11 +152,12 @@ fn convert_gradient(
|
||||||
RelativeTo::Parent => state.container_size(),
|
RelativeTo::Parent => state.container_size(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let angle = gradient.angle().unwrap_or_else(Angle::zero);
|
let mut angle = gradient.angle().unwrap_or_else(Angle::zero);
|
||||||
let base_transform = correct_transform(state, gradient.unwrap_relative(on_text));
|
let base_transform = correct_transform(state, gradient.unwrap_relative(on_text));
|
||||||
let stops = convert_gradient_stops(gradient);
|
let stops = convert_gradient_stops(gradient);
|
||||||
match &gradient {
|
match &gradient {
|
||||||
Gradient::Linear(_) => {
|
Gradient::Linear(_) => {
|
||||||
|
angle = Gradient::correct_aspect_ratio(angle, size.aspect_ratio());
|
||||||
let (x1, y1, x2, y2) = {
|
let (x1, y1, x2, y2) = {
|
||||||
let (mut sin, mut cos) = (angle.sin(), angle.cos());
|
let (mut sin, mut cos) = (angle.sin(), angle.cos());
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 137 B |
|
|
@ -692,3 +692,6 @@ $ A = mat(
|
||||||
(blue, 100%),
|
(blue, 100%),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
--- issue-6680-gradient-linear-with-aspect-correction ---
|
||||||
|
#set page(width: 200pt, height: auto, margin: 10pt, fill: gradient.linear(red, blue, angle: 45deg).sharp(2))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue