@@ -67,7 +67,7 @@ struct XY
67
67
template <class PathIterator , class PointArray , class ResultArray >
68
68
void point_in_path_impl (PointArray &points, PathIterator &path, ResultArray &inside_flag)
69
69
{
70
- int yflag1;
70
+ bool yflag1;
71
71
double vtx0, vty0, vtx1, vty1;
72
72
double tx, ty;
73
73
double sx, sy;
@@ -77,13 +77,13 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
77
77
78
78
size_t n = points.size ();
79
79
80
- std::vector<int > yflag0 (n);
81
- std::vector<int > subpath_flag (n);
80
+ std::vector<bool > yflag0 (n);
81
+ std::vector<bool > subpath_flag (n);
82
82
83
83
path.rewind (0 );
84
84
85
85
for (i = 0 ; i < n; ++i) {
86
- inside_flag[i] = 0 ;
86
+ inside_flag[i] = false ;
87
87
}
88
88
89
89
unsigned code = 0 ;
@@ -106,7 +106,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
106
106
// get test bit for above/below X axis
107
107
yflag0[i] = (vty0 >= ty);
108
108
109
- subpath_flag[i] = 0 ;
109
+ subpath_flag[i] = false ;
110
110
}
111
111
}
112
112
@@ -152,7 +152,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
152
152
// Haigh-Hutchinson's different polygon inclusion
153
153
// tests.
154
154
if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
155
- subpath_flag[i] ^= 1 ;
155
+ subpath_flag[i] = subpath_flag[i] ^ true ;
156
156
}
157
157
}
158
158
@@ -181,11 +181,11 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
181
181
yflag1 = (vty1 >= ty);
182
182
if (yflag0[i] != yflag1) {
183
183
if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
184
- subpath_flag[i] ^= 1 ;
184
+ subpath_flag[i] = subpath_flag[i] ^ true ;
185
185
}
186
186
}
187
- inside_flag[i] |= subpath_flag[i];
188
- if (inside_flag[i] == 0 ) {
187
+ inside_flag[i] = inside_flag[i] || subpath_flag[i];
188
+ if (inside_flag[i] == false ) {
189
189
all_done = false ;
190
190
}
191
191
}
@@ -210,7 +210,7 @@ inline void points_in_path(PointArray &points,
210
210
211
211
size_t i;
212
212
for (i = 0 ; i < result.size (); ++i) {
213
- result[i] = 0 ;
213
+ result[i] = false ;
214
214
}
215
215
216
216
if (path.total_vertices () < 3 ) {
@@ -236,8 +236,8 @@ inline bool point_in_path(
236
236
point.push_back (y);
237
237
points.push_back (point);
238
238
239
- std::vector<uint8_t > result (1 );
240
- result[0 ] = 0 ;
239
+ std::vector<bool > result (1 );
240
+ result[0 ] = false ;
241
241
242
242
points_in_path (points, r, path, trans, result);
243
243
@@ -258,7 +258,7 @@ void points_on_path(PointArray &points,
258
258
259
259
size_t i;
260
260
for (i = 0 ; i < result.size (); ++i) {
261
- result[i] = 0 ;
261
+ result[i] = false ;
262
262
}
263
263
264
264
transformed_path_t trans_path (path, trans);
@@ -279,8 +279,8 @@ inline bool point_on_path(
279
279
point.push_back (y);
280
280
points.push_back (point);
281
281
282
- std::vector<uint8_t > result (1 );
283
- result[0 ] = 0 ;
282
+ std::vector<bool > result (1 );
283
+ result[0 ] = false ;
284
284
285
285
points_on_path (points, r, path, trans, result);
286
286
0 commit comments