@@ -302,14 +302,8 @@ Py_convert_path_to_polygons(mpl::PathIterator path, agg::trans_affine trans,
302302static py::tuple
303303Py_cleanup_path (mpl::PathIterator path, agg::trans_affine trans, bool remove_nans,
304304 agg::rect_d clip_rect, e_snap_mode snap_mode, double stroke_width,
305- std::optional<bool > simplify, bool return_curves, py::object sketch_obj )
305+ std::optional<bool > simplify, bool return_curves, SketchParams sketch )
306306{
307- SketchParams sketch;
308-
309- if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
310- throw py::error_already_set ();
311- }
312-
313307 if (!simplify.has_value ()) {
314308 simplify = path.should_simplify ();
315309 }
@@ -367,18 +361,13 @@ postfix : bool
367361static py::object
368362Py_convert_to_string (mpl::PathIterator path, agg::trans_affine trans,
369363 agg::rect_d cliprect, std::optional<bool > simplify,
370- py::object sketch_obj , int precision,
364+ SketchParams sketch , int precision,
371365 std::array<std::string, 5 > codes_obj, bool postfix)
372366{
373- SketchParams sketch;
374367 char *codes[5 ];
375368 std::string buffer;
376369 bool status;
377370
378- if (!convert_sketch_params (sketch_obj.ptr (), &sketch)) {
379- throw py::error_already_set ();
380- }
381-
382371 for (auto i = 0 ; i < 5 ; ++i) {
383372 codes[i] = const_cast <char *>(codes_obj[i].c_str ());
384373 }
0 commit comments