@@ -50,6 +50,7 @@ pub struct Contour {
50
50
51
51
bitflags ! {
52
52
/// Flags that specify what type of point the corresponding position represents.
53
+ #[ derive( Clone , Debug , PartialEq ) ]
53
54
pub struct PointFlags : u8 {
54
55
/// This point is the control point of a quadratic Bézier curve or the first control point
55
56
/// of a cubic Bézier curve.
@@ -117,20 +118,20 @@ impl Contour {
117
118
sink. move_to ( self . positions [ 0 ] ) ;
118
119
119
120
let mut iter = self . positions [ 1 ..] . iter ( ) . zip ( self . flags [ 1 ..] . iter ( ) ) ;
120
- while let Some ( ( & position_0, & flags_0) ) = iter. next ( ) {
121
- if flags_0 == PointFlags :: empty ( ) {
121
+ while let Some ( ( & position_0, ref flags_0) ) = iter. next ( ) {
122
+ if flags_0. is_empty ( ) {
122
123
sink. line_to ( position_0) ;
123
124
continue ;
124
125
}
125
126
126
- let ( & position_1, & flags_1) = iter. next ( ) . expect ( "Invalid outline!" ) ;
127
- if flags_1 == PointFlags :: empty ( ) {
127
+ let ( & position_1, ref flags_1) = iter. next ( ) . expect ( "Invalid outline!" ) ;
128
+ if flags_1. is_empty ( ) {
128
129
sink. quadratic_curve_to ( position_0, position_1) ;
129
130
continue ;
130
131
}
131
132
132
- let ( & position_2, & flags_2) = iter. next ( ) . expect ( "Invalid outline!" ) ;
133
- debug_assert_eq ! ( flags_2, PointFlags :: empty ( ) ) ;
133
+ let ( & position_2, ref flags_2) = iter. next ( ) . expect ( "Invalid outline!" ) ;
134
+ debug_assert ! ( flags_2. is_empty ( ) ) ;
134
135
sink. cubic_curve_to ( LineSegment2F :: new ( position_0, position_1) , position_2) ;
135
136
}
136
137
0 commit comments