Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aef86ad

Browse files
committed
Don't use contouring on the path unless necessary
1 parent 7976970 commit aef86ad

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/_path.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,13 @@ inline void points_in_path(PointArray &points,
233233
transformed_path_t trans_path(path, trans);
234234
no_nans_t no_nans_path(trans_path, true, path.has_curves());
235235
curve_t curved_path(no_nans_path);
236-
contour_t contoured_path(curved_path);
237-
contoured_path.width(r);
238-
239-
point_in_path_impl(points, contoured_path, result);
236+
if (r != 0.0) {
237+
contour_t contoured_path(curved_path);
238+
contoured_path.width(r);
239+
point_in_path_impl(points, contoured_path, result);
240+
} else {
241+
point_in_path_impl(points, curved_path, result);
242+
}
240243
}
241244

242245
template <class PathIterator>

0 commit comments

Comments
 (0)