Skip to main content

inverse_apply_transform

Function inverse_apply_transform 

Source
pub fn inverse_apply_transform(
    world_p: Point,
    t: Transform2D,
    cx: f32,
    cy: f32,
) -> Point
Expand description

阶段 5:把世界坐标 p 通过 Transform2D 反向变换到 layer 局部坐标

forward(world_p) = R(rot) * S(sx, sy) * (local_p - center) + center + translate 反向: local_p = S(1/sx, 1/sy) * R(-rot) * (world_p - center - translate) + center