@@ -152,7 +152,6 @@ namespace PYBIND11_NAMESPACE { namespace detail {
152
152
{" round" , agg::round_join},
153
153
{" bevel" , agg::bevel_join},
154
154
};
155
- value = agg::miter_join_revert;
156
155
value = enum_values.at (src.cast <std::string>());
157
156
return true ;
158
157
}
@@ -167,13 +166,12 @@ namespace PYBIND11_NAMESPACE { namespace detail {
167
166
return true ;
168
167
}
169
168
170
- auto clippath_tuple = src.cast <py::tuple>();
171
-
172
- auto path = clippath_tuple[0 ];
173
- if (!path.is_none ()) {
174
- value.path = path.cast <mpl::PathIterator>();
169
+ auto [path, trans] =
170
+ src.cast <std::pair<std::optional<mpl::PathIterator>, agg::trans_affine>>();
171
+ if (path) {
172
+ value.path = *path;
175
173
}
176
- value.trans = clippath_tuple[ 1 ]. cast <agg::trans_affine>() ;
174
+ value.trans = trans ;
177
175
178
176
return true ;
179
177
}
@@ -184,15 +182,14 @@ namespace PYBIND11_NAMESPACE { namespace detail {
184
182
PYBIND11_TYPE_CASTER (Dashes, const_name(" Dashes" ));
185
183
186
184
bool load (handle src, bool ) {
187
- auto dash_tuple = src.cast <py::tuple>();
188
- auto dash_offset = dash_tuple[0 ].cast <double >();
189
- auto dashes_seq_or_none = dash_tuple[1 ];
185
+ auto [dash_offset, dashes_seq_or_none] =
186
+ src.cast <std::pair<double , std::optional<py::sequence>>>();
190
187
191
- if (dashes_seq_or_none. is_none () ) {
188
+ if (! dashes_seq_or_none) {
192
189
return true ;
193
190
}
194
191
195
- auto dashes_seq = dashes_seq_or_none. cast <py::sequence>() ;
192
+ auto dashes_seq = * dashes_seq_or_none;
196
193
197
194
auto nentries = dashes_seq.size ();
198
195
// If the dashpattern has odd length, iterate through it twice (in
0 commit comments