mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-01 18:25:32 -06:00
Stack d1: #2368: refuse a key point search over more than 10,000 objects
The search took the first 10,000 objects and could miss a nearer key point on a later one; now it says so and asks for a point.
This commit is contained in:
@@ -224,7 +224,7 @@ fn source_key_point(d: &Drawing, h: Handle, at: Vec2, tol: f64) -> Result<Vec2>
|
||||
let (ins, blk, p) = array_of(d, h)?;
|
||||
let src = d.block(&p.source).ok_or_else(|| other("The array's source block is missing."))?;
|
||||
let m = ins.transform(blk.base.xy()).then_before(item_place(&p, item)?).then_before(Mat3::translate(-src.base.xy()));
|
||||
nearest_key_point(src.entities.iter().map(|e| e.as_ref()), &m, at).ok_or_else(|| other("The source objects have no key point; specify a point."))
|
||||
nearest_key_point(src.entities.iter().map(|e| e.as_ref()), &m, at)?.ok_or_else(|| other("The source objects have no key point; specify a point."))
|
||||
}
|
||||
|
||||
/// Move the base point of array `h` to world point `base` without moving the items.
|
||||
|
||||
Reference in New Issue
Block a user