mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-28 03:37:00 -06:00
DXF export: format the far-coordinate check
This commit is contained in:
@@ -182,7 +182,10 @@ const MAX_POINTS: usize = 4_000_000;
|
|||||||
fn polygons(bp: &BezPath) -> Vec<Vec<Point>> {
|
fn polygons(bp: &BezPath) -> Vec<Vec<Point>> {
|
||||||
// Far outside any drawing, a curve flattens to millions of points at this tolerance.
|
// Far outside any drawing, a curve flattens to millions of points at this tolerance.
|
||||||
let b = bp.control_box();
|
let b = bp.control_box();
|
||||||
if !matches!(b.x0.abs().max(b.x1.abs()).max(b.y0.abs()).max(b.y1.abs()).partial_cmp(&MAX_COORD), Some(std::cmp::Ordering::Less | std::cmp::Ordering::Equal)) {
|
if !matches!(
|
||||||
|
b.x0.abs().max(b.x1.abs()).max(b.y0.abs()).max(b.y1.abs()).partial_cmp(&MAX_COORD),
|
||||||
|
Some(std::cmp::Ordering::Less | std::cmp::Ordering::Equal)
|
||||||
|
) {
|
||||||
return vec![];
|
return vec![];
|
||||||
}
|
}
|
||||||
let mut out: Vec<Vec<Point>> = vec![];
|
let mut out: Vec<Vec<Point>> = vec![];
|
||||||
|
|||||||
Reference in New Issue
Block a user