diff --git a/goopylib/header.h b/goopylib/header.h index f2833cea..0868d781 100644 --- a/goopylib/header.h +++ b/goopylib/header.h @@ -33,8 +33,8 @@ #define _GP_COLOR_SETTER(cls, ...) MAP(GP_TO_COLOR, MAP_LIST(_GP_COLOR_PREFIX, __VA_ARGS__)) self.setColor(MAP_LIST(_GP_COLOR_CAST, __VA_ARGS__)) #define GP_COLOR_SETTER(cls, ...) [Color](_GP_COLOR_SETTER_ARGS(cls, __VA_ARGS__)) { _GP_COLOR_SETTER(cls, __VA_ARGS__); } -#define _GP_COLOR_SETTER1(cls) .def("set_color", py::overload_cast(&cls::setColor)) -#define _GP_COLOR_SETTER2(cls) .def("set_color", py::overload_cast(&cls::setColor), "color"_a, "alpha"_a=1) -#define _GP_COLOR_SETTER3(cls) .def("set_color", py::overload_cast(&cls::setColor), "red"_a, "green"_a, "blue"_a, "alpha"_a=1) +#define _GP_COLOR_SETTER1(cls) .def("set_color", static_cast(&cls::setColor)) +#define _GP_COLOR_SETTER2(cls) .def("set_color", static_cast(&cls::setColor), "color"_a, "alpha"_a=1) +#define _GP_COLOR_SETTER3(cls) .def("set_color", static_cast(&cls::setColor), "red"_a, "green"_a, "blue"_a, "alpha"_a=1) #define _GP_COLOR_SETTER4(cls, ...) .def("set_color", GP_COLOR_SETTER(cls, __VA_ARGS__)) #define GP_COLOR_SETTERS(cls, ...) _GP_COLOR_SETTER1(cls) _GP_COLOR_SETTER2(cls) _GP_COLOR_SETTER3(cls) _GP_COLOR_SETTER4(cls, __VA_ARGS__) diff --git a/goopylib/objects/line.cpp b/goopylib/objects/line.cpp index e98b318e..6c4512ae 100644 --- a/goopylib/objects/line.cpp +++ b/goopylib/objects/line.cpp @@ -16,7 +16,7 @@ PYBIND11_MODULE(line, m) { return new gp::Line(v1, v2, thickness); }), "p1"_a, "p2"_a, "thickness"_a = 3) - GP_COLOR_SETTERS(gp::Line, 1, 2, 3, 4) + GP_COLOR_SETTERS(gp::Quad, 1, 2, 3, 4) .def("set_color", GP_COLOR_SETTER(gp::Line, 1, 2)) .def_property("transparency",