refactor: drop residual zero-subtraction from world_offset removal
In the files where ox/oy/oz came solely from the now-zero offset destructure (tessellate, block_cache, dimension, leader, text_support), remove the `let [ox,oy,oz] = [0,0,0]` binding and the `- ox` arithmetic so the coordinate math reads as the plain absolute value it now is. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
56d507fd88
commit
29415cac20
5 changed files with 46 additions and 66 deletions
|
|
@ -1449,10 +1449,9 @@ fn text_fill_rect(
|
|||
let (sr, cr) = rot.sin_cos();
|
||||
let hx = approx_w * 0.5;
|
||||
let hy = approx_h * 0.5;
|
||||
let [ox, oy, oz] = [0.0_f64; 3];
|
||||
let cx = (pos.x - ox) as f32;
|
||||
let cy = (pos.y - oy) as f32;
|
||||
let cz = (pos.z - oz) as f32;
|
||||
let cx = (pos.x) as f32;
|
||||
let cy = (pos.y) as f32;
|
||||
let cz = (pos.z) as f32;
|
||||
let corner = |dx: f64, dy: f64| -> [f32; 3] {
|
||||
let lx = dx * cr - dy * sr;
|
||||
let ly = dx * sr + dy * cr;
|
||||
|
|
|
|||
|
|
@ -589,9 +589,8 @@ impl LeaderTess for Leader {
|
|||
entity_color
|
||||
};
|
||||
let name = handle.value().to_string();
|
||||
let [ox, oy, oz] = [0.0_f64; 3];
|
||||
let p3 = |v: &acadrust::types::Vector3| -> [f32; 3] {
|
||||
[(v.x - ox) as f32, (v.y - oy) as f32, (v.z - oz) as f32]
|
||||
[(v.x) as f32, (v.y) as f32, (v.z) as f32]
|
||||
};
|
||||
let nan = [f32::NAN; 3];
|
||||
|
||||
|
|
|
|||
|
|
@ -1722,9 +1722,8 @@ pub(crate) fn text_baseline_points(
|
|||
return vec![];
|
||||
}
|
||||
let n_lines = n_lines.max(1);
|
||||
let [ox, oy, oz] = [0.0_f64; 3];
|
||||
let cast = |p: [f64; 3]| -> [f32; 3] {
|
||||
[(p[0] - ox) as f32, (p[1] - oy) as f32, (p[2] - oz) as f32]
|
||||
[(p[0]) as f32, (p[1]) as f32, (p[2]) as f32]
|
||||
};
|
||||
let bl = cast(corners[0]);
|
||||
let br = cast(corners[1]);
|
||||
|
|
@ -1782,9 +1781,8 @@ pub(crate) fn text_greek_obb_tris(
|
|||
return vec![];
|
||||
}
|
||||
let n_lines = n_lines.max(1);
|
||||
let [ox, oy, oz] = [0.0_f64; 3];
|
||||
let cast = |p: [f64; 3]| -> [f32; 3] {
|
||||
[(p[0] - ox) as f32, (p[1] - oy) as f32, (p[2] - oz) as f32]
|
||||
[(p[0]) as f32, (p[1]) as f32, (p[2]) as f32]
|
||||
};
|
||||
let bl = cast(corners[0]);
|
||||
let br = cast(corners[1]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue