|
11 | 11 |
|
12 | 12 | #include "_path.h"
|
13 | 13 |
|
| 14 | +#include "_backend_agg_basic_types.h" |
14 | 15 | #include "py_adaptors.h"
|
15 | 16 | #include "py_converters.h"
|
16 | 17 | #include "py_converters_11.h"
|
@@ -288,14 +289,8 @@ Py_convert_path_to_polygons(mpl::PathIterator path, agg::trans_affine trans,
|
288 | 289 | static py::tuple
|
289 | 290 | Py_cleanup_path(mpl::PathIterator path, agg::trans_affine trans, bool remove_nans,
|
290 | 291 | agg::rect_d clip_rect, e_snap_mode snap_mode, double stroke_width,
|
291 |
| - std::optional<bool> simplify, bool return_curves, py::object sketch_obj) |
| 292 | + std::optional<bool> simplify, bool return_curves, SketchParams sketch) |
292 | 293 | {
|
293 |
| - SketchParams sketch; |
294 |
| - |
295 |
| - if (!convert_sketch_params(sketch_obj.ptr(), &sketch)) { |
296 |
| - throw py::error_already_set(); |
297 |
| - } |
298 |
| - |
299 | 294 | if (!simplify.has_value()) {
|
300 | 295 | simplify = path.should_simplify();
|
301 | 296 | }
|
@@ -350,18 +345,13 @@ postfix : bool
|
350 | 345 | static py::object
|
351 | 346 | Py_convert_to_string(mpl::PathIterator path, agg::trans_affine trans,
|
352 | 347 | agg::rect_d cliprect, std::optional<bool> simplify,
|
353 |
| - py::object sketch_obj, int precision, |
| 348 | + SketchParams sketch, int precision, |
354 | 349 | std::array<std::string, 5> codes_obj, bool postfix)
|
355 | 350 | {
|
356 |
| - SketchParams sketch; |
357 | 351 | char *codes[5];
|
358 | 352 | std::string buffer;
|
359 | 353 | bool status;
|
360 | 354 |
|
361 |
| - if (!convert_sketch_params(sketch_obj.ptr(), &sketch)) { |
362 |
| - throw py::error_already_set(); |
363 |
| - } |
364 |
| - |
365 | 355 | for (auto i = 0; i < 5; ++i) {
|
366 | 356 | codes[i] = const_cast<char *>(codes_obj[i].c_str());
|
367 | 357 | }
|
|
0 commit comments