INNER CODE UNIT · Rust
radii
rlaope/estudy · site/graph/crates/graph-wasm/src/lib.rs:161
pub fn radii() -> Vec<f32> {
G.with(|g| g.borrow().radius.clone())
}
/// 월드→화면 변환: `sx = x*scale + tx`, `sy = y*scale + ty` (CSS px). 히트테스트/라벨 컬링이 쓴다.
/// `node_scale` 은 화면 반지름 배율(JS 렌더러와 같은 값을 넘긴다).
#[wasm_bindgen]
pub fn set_view(scale: f32, tx: f32, ty: f32, width: f32, height: f32, node_scale: f32) {
G.with(|g| {
g.borrow_mut().view = Some(View {
scale,
tx,
ty,
width,
height,
node_scale,
});
});