Skip to content

Commit bb4f83f

Browse files
committed
[curve] remove dead code
1 parent b88b0fe commit bb4f83f

File tree

2 files changed

+2
-30
lines changed

2 files changed

+2
-30
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rasterize"
3-
version = "0.6.6"
3+
version = "0.6.7"
44
authors = ["Pavel Aslanov <asl.pavel@gmail.com>"]
55
description = "Simple and small 2D rendering library"
66
edition = "2024"

src/curve.rs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -873,34 +873,6 @@ impl Curve for Cubic {
873873
}
874874
}
875875

876-
pub struct CubicFlattenIter {
877-
flatness: Scalar,
878-
cubics: Vec<Cubic>,
879-
}
880-
881-
impl Iterator for CubicFlattenIter {
882-
type Item = Line;
883-
884-
fn next(&mut self) -> Option<Self::Item> {
885-
loop {
886-
match self.cubics.pop() {
887-
None => {
888-
return None;
889-
}
890-
Some(cubic) if cubic.flatness() < self.flatness => {
891-
let Cubic([p0, _p1, _p2, p3]) = cubic;
892-
return Some(Line([p0, p3]));
893-
}
894-
Some(cubic) => {
895-
let (c0, c1) = cubic.split();
896-
self.cubics.push(c1);
897-
self.cubics.push(c0);
898-
}
899-
}
900-
}
901-
}
902-
}
903-
904876
impl From<Quad> for Cubic {
905877
fn from(quad: Quad) -> Self {
906878
let Quad([p0, p1, p2]) = quad;
@@ -1452,7 +1424,7 @@ fn cubic_offset_should_split(cubic: Cubic) -> bool {
14521424
return true;
14531425
}
14541426
// distance between center mass and midpoint of a curve,
1455-
// should be bigger then 0.1 of the bounding box diagonal
1427+
// should be bigger than 0.1 of the bounding box diagonal
14561428
let c_mass = (p0 + p1 + p2 + p3) / 4.0;
14571429
let c_mid = cubic.at(0.5);
14581430
let dist = (c_mass - c_mid).length();

0 commit comments

Comments
 (0)