Skip to content

Commit f390e9f

Browse files
committed
fix tests
1 parent 6a73362 commit f390e9f

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

iOverlay/src/vector/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ mod tests {
405405
#[rustfmt::skip]
406406
let subj = int_shape![
407407
[[2, 3], [3, 3], [3, 4], [2, 4]],
408-
[[1, 3], [1, 4], [2, 4], [1, 3]]
408+
[[1, 3], [1, 4], [2, 4], [2, 3]]
409409
];
410410
let mut buffer = Default::default();
411411
let mut overlay = Overlay::with_contours(&subj, &[]);

iOverlay/tests/vector_tests.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,25 @@ mod tests {
3333

3434
let vectors = &shapes[0][0];
3535
let template = [
36-
VectorEdge {
37-
a: IntPoint::new(-10240,-10240),
38-
b: IntPoint::new(-10240,10240),
39-
fill: 2
40-
},
4136
VectorEdge {
4237
a: IntPoint::new(-10240,10240),
43-
b: IntPoint::new(10240,10240),
44-
fill: 2
38+
b: IntPoint::new(-10240,-10240),
39+
fill: 1
4540
},
4641
VectorEdge {
47-
a: IntPoint::new(10240,10240),
42+
a: IntPoint::new(-10240,-10240),
4843
b: IntPoint::new(10240,-10240),
49-
fill: 2
44+
fill: 1
5045
},
5146
VectorEdge {
5247
a: IntPoint::new(10240,-10240),
53-
b: IntPoint::new(-10240,-10240),
54-
fill: 2
48+
b: IntPoint::new(10240,10240),
49+
fill: 1
50+
},
51+
VectorEdge {
52+
a: IntPoint::new(10240,10240),
53+
b: IntPoint::new(-10240,10240),
54+
fill: 1
5555
}
5656
];
5757

@@ -78,42 +78,42 @@ mod tests {
7878
overlay.add_contour(&subj, ShapeType::Subject);
7979
overlay.add_contour(&clip, ShapeType::Clip);
8080

81-
let shapes = overlay.build_shape_vectors(FillRule::NonZero, OverlayRule::Subject);
81+
let shapes = overlay.build_shape_vectors(FillRule::NonZero, OverlayRule::Difference);
8282

8383
assert_eq!(shapes.len(), 1);
8484
assert_eq!(shapes[0].len(), 1);
8585

8686
let vectors = &shapes[0][0];
8787
let template = [
88-
VectorEdge {
89-
a: IntPoint::new(-10240,-10240),
90-
b: IntPoint::new(-10240,10240),
91-
fill: 2
92-
},
9388
VectorEdge {
9489
a: IntPoint::new(-10240,10240),
95-
b: IntPoint::new(-5120,10240),
96-
fill: 2
90+
b: IntPoint::new(-10240,-10240),
91+
fill: 1
9792
},
9893
VectorEdge {
99-
a: IntPoint::new(-5120,10240),
100-
b: IntPoint::new(10240,10240),
101-
fill: 14
94+
a: IntPoint::new(-10240,-10240),
95+
b: IntPoint::new(10240,-10240),
96+
fill: 1
10297
},
10398
VectorEdge {
104-
a: IntPoint::new(10240,10240),
99+
a: IntPoint::new(10240,-10240),
105100
b: IntPoint::new(10240,-5120),
106-
fill: 14
101+
fill: 1
107102
},
108103
VectorEdge {
109104
a: IntPoint::new(10240,-5120),
110-
b: IntPoint::new(10240,-10240),
111-
fill: 2
105+
b: IntPoint::new(-5120,-5120),
106+
fill: 11
112107
},
113108
VectorEdge {
114-
a: IntPoint::new(10240,-10240),
115-
b: IntPoint::new(-10240,-10240),
116-
fill: 2
109+
a: IntPoint::new(-5120,-5120),
110+
b: IntPoint::new(-5120,10240),
111+
fill: 11
112+
},
113+
VectorEdge {
114+
a: IntPoint::new(-5120,10240),
115+
b: IntPoint::new(-10240,10240),
116+
fill: 1
117117
}
118118
];
119119

0 commit comments

Comments
 (0)