mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-23 18:06:34 +11:00
refactor common scale ratio code
This commit is contained in:
parent
58c7df469d
commit
7b68630d6a
1 changed files with 3 additions and 3 deletions
|
@ -201,9 +201,9 @@ fn main(
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
let a = radius * radius - 1.0;
|
let a = radius * radius - 1.0;
|
||||||
let a_recip = 1.0 / a;
|
let scale_ratio = abs(1.0 - focal_x) / a;
|
||||||
let scale_x = radius * a_recip * abs(1.0 - focal_x);
|
let scale_x = radius * scale_ratio;
|
||||||
let scale_y = sqrt(abs(a)) * a_recip * abs(1.0 - focal_x);
|
let scale_y = sqrt(abs(a)) * scale_ratio;
|
||||||
user_to_scaled = transform_mul(
|
user_to_scaled = transform_mul(
|
||||||
Transform(vec4(scale_x, 0.0, 0.0, scale_y), vec2(0.0)),
|
Transform(vec4(scale_x, 0.0, 0.0, scale_y), vec2(0.0)),
|
||||||
user_to_unit_line
|
user_to_unit_line
|
||||||
|
|
Loading…
Add table
Reference in a new issue