diff --git a/wx/svg/_nanosvg.c b/wx/svg/_nanosvg.c index 1547de70..028a1ce9 100644 --- a/wx/svg/_nanosvg.c +++ b/wx/svg/_nanosvg.c @@ -1047,7 +1047,7 @@ struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient { }; -/* "wx/svg/_nanosvg.pyx":546 +/* "wx/svg/_nanosvg.pyx":536 * * #---------------------------------------------------------------------------- * cdef class SVGgradientStop: # <<<<<<<<<<<<<< @@ -1189,7 +1189,7 @@ struct __pyx_vtabstruct_2wx_3svg_8_nanosvg_SVGgradient { static struct __pyx_vtabstruct_2wx_3svg_8_nanosvg_SVGgradient *__pyx_vtabptr_2wx_3svg_8_nanosvg_SVGgradient; -/* "wx/svg/_nanosvg.pyx":546 +/* "wx/svg/_nanosvg.pyx":536 * * #---------------------------------------------------------------------------- * cdef class SVGgradientStop: # <<<<<<<<<<<<<< @@ -2235,8 +2235,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_2fx___get__(struct __ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_2fy___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_5stops___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_12linearPoints___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop___cinit__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *__pyx_v_self); /* proto */ @@ -9448,25 +9447,25 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_12linearPoints___get_ /* "wx/svg/_nanosvg.pyx":517 * * @property - * def radialPoint(self): # <<<<<<<<<<<<<< - * cdef float inverse[6] - * cdef float cx, cy, radius + * def radialPointRadius(self) -> tuple: # <<<<<<<<<<<<<< + * """ + * For radial gradients this returns the center point and the radius as a */ /* Python wrapper */ -static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint_1__get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius_1__get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint___get__(((struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *)__pyx_v_self)); + __pyx_r = __pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius___get__(((struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self) { +static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self) { float __pyx_v_inverse[6]; float __pyx_v_cx; float __pyx_v_cy; @@ -9478,80 +9477,84 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint___get__ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "wx/svg/_nanosvg.pyx":522 + /* "wx/svg/_nanosvg.pyx":525 + * cdef float cx, cy, radius * cdef float r1, r2 - * * nsvg__xformInverse(inverse, self._ptr.xform) # <<<<<<<<<<<<<< * * nsvg__xformPoint(&cx, &cy, 0, 0, inverse) */ nsvg__xformInverse(__pyx_v_inverse, __pyx_v_self->_ptr->xform); - /* "wx/svg/_nanosvg.pyx":524 + /* "wx/svg/_nanosvg.pyx":527 * nsvg__xformInverse(inverse, self._ptr.xform) * * nsvg__xformPoint(&cx, &cy, 0, 0, inverse) # <<<<<<<<<<<<<< * nsvg__xformPoint(&r1, &r2, 0, 1, inverse) - * radius = r2 - cy + * radius = r2 - r1 */ nsvg__xformPoint((&__pyx_v_cx), (&__pyx_v_cy), 0.0, 0.0, __pyx_v_inverse); - /* "wx/svg/_nanosvg.pyx":525 + /* "wx/svg/_nanosvg.pyx":528 * * nsvg__xformPoint(&cx, &cy, 0, 0, inverse) * nsvg__xformPoint(&r1, &r2, 0, 1, inverse) # <<<<<<<<<<<<<< - * radius = r2 - cy + * radius = r2 - r1 * */ nsvg__xformPoint((&__pyx_v_r1), (&__pyx_v_r2), 0.0, 1.0, __pyx_v_inverse); - /* "wx/svg/_nanosvg.pyx":526 + /* "wx/svg/_nanosvg.pyx":529 * nsvg__xformPoint(&cx, &cy, 0, 0, inverse) * nsvg__xformPoint(&r1, &r2, 0, 1, inverse) - * radius = r2 - cy # <<<<<<<<<<<<<< + * radius = r2 - r1 # <<<<<<<<<<<<<< * - * return (cx, cy, radius) + * return ((cx, cy), radius) */ - __pyx_v_radius = (__pyx_v_r2 - __pyx_v_cy); + __pyx_v_radius = (__pyx_v_r2 - __pyx_v_r1); - /* "wx/svg/_nanosvg.pyx":528 - * radius = r2 - cy + /* "wx/svg/_nanosvg.pyx":531 + * radius = r2 - r1 + * + * return ((cx, cy), radius) # <<<<<<<<<<<<<< * - * return (cx, cy, radius) # <<<<<<<<<<<<<< * - * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_cx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_cx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "wx/svg/_nanosvg.pyx":517 * * @property - * def radialPoint(self): # <<<<<<<<<<<<<< - * cdef float inverse[6] - * cdef float cx, cy, radius + * def radialPointRadius(self) -> tuple: # <<<<<<<<<<<<<< + * """ + * For radial gradients this returns the center point and the radius as a */ /* function exit code */ @@ -9559,129 +9562,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint___get__ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("wx.svg._nanosvg.SVGgradient.radialPoint.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "wx/svg/_nanosvg.pyx":531 - * - * @property - * def radialPoint2(self): # <<<<<<<<<<<<<< - * cdef float inverse[6] - * cdef float cx, cy, radius - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2___get__(((struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2___get__(struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradient *__pyx_v_self) { - float __pyx_v_inverse[6]; - float __pyx_v_cx; - float __pyx_v_cy; - float __pyx_v_radius; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "wx/svg/_nanosvg.pyx":536 - * cdef float r1, r2 - * - * nsvg__xformInverse(inverse, self._ptr.xform) # <<<<<<<<<<<<<< - * - * cx = inverse[4] - */ - nsvg__xformInverse(__pyx_v_inverse, __pyx_v_self->_ptr->xform); - - /* "wx/svg/_nanosvg.pyx":538 - * nsvg__xformInverse(inverse, self._ptr.xform) - * - * cx = inverse[4] # <<<<<<<<<<<<<< - * cy = inverse[5] - * radius = inverse[0] - */ - __pyx_v_cx = (__pyx_v_inverse[4]); - - /* "wx/svg/_nanosvg.pyx":539 - * - * cx = inverse[4] - * cy = inverse[5] # <<<<<<<<<<<<<< - * radius = inverse[0] - * - */ - __pyx_v_cy = (__pyx_v_inverse[5]); - - /* "wx/svg/_nanosvg.pyx":540 - * cx = inverse[4] - * cy = inverse[5] - * radius = inverse[0] # <<<<<<<<<<<<<< - * - * return (cx, cy, radius) - */ - __pyx_v_radius = (__pyx_v_inverse[0]); - - /* "wx/svg/_nanosvg.pyx":542 - * radius = inverse[0] - * - * return (cx, cy, radius) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_cx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "wx/svg/_nanosvg.pyx":531 - * - * @property - * def radialPoint2(self): # <<<<<<<<<<<<<< - * cdef float inverse[6] - * cdef float cx, cy, radius - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("wx.svg._nanosvg.SVGgradient.radialPoint2.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("wx.svg._nanosvg.SVGgradient.radialPointRadius.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -9798,7 +9679,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_11SVGgradient_6__setstate_cython__( return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":551 +/* "wx/svg/_nanosvg.pyx":541 * cdef NSVGgradientStop *_ptr * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -9827,7 +9708,7 @@ static int __pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop___cinit__(struct __pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "wx/svg/_nanosvg.pyx":552 + /* "wx/svg/_nanosvg.pyx":542 * * def __cinit__(self): * self._ptr = NULL # <<<<<<<<<<<<<< @@ -9836,7 +9717,7 @@ static int __pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop___cinit__(struct __pyx_ */ __pyx_v_self->_ptr = NULL; - /* "wx/svg/_nanosvg.pyx":551 + /* "wx/svg/_nanosvg.pyx":541 * cdef NSVGgradientStop *_ptr * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -9850,7 +9731,7 @@ static int __pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop___cinit__(struct __pyx_ return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":555 +/* "wx/svg/_nanosvg.pyx":545 * * @staticmethod * cdef SVGgradientStop from_ptr(NSVGgradientStop *ptr): # <<<<<<<<<<<<<< @@ -9865,19 +9746,19 @@ static struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *__pyx_f_2wx_3svg_8_n PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("from_ptr", 0); - /* "wx/svg/_nanosvg.pyx":556 + /* "wx/svg/_nanosvg.pyx":546 * @staticmethod * cdef SVGgradientStop from_ptr(NSVGgradientStop *ptr): * obj = SVGgradientStop() # <<<<<<<<<<<<<< * obj._ptr = ptr * return obj */ - __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2wx_3svg_8_nanosvg_SVGgradientStop)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_2wx_3svg_8_nanosvg_SVGgradientStop)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_obj = ((struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *)__pyx_t_1); __pyx_t_1 = 0; - /* "wx/svg/_nanosvg.pyx":557 + /* "wx/svg/_nanosvg.pyx":547 * cdef SVGgradientStop from_ptr(NSVGgradientStop *ptr): * obj = SVGgradientStop() * obj._ptr = ptr # <<<<<<<<<<<<<< @@ -9886,7 +9767,7 @@ static struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *__pyx_f_2wx_3svg_8_n */ __pyx_v_obj->_ptr = __pyx_v_ptr; - /* "wx/svg/_nanosvg.pyx":558 + /* "wx/svg/_nanosvg.pyx":548 * obj = SVGgradientStop() * obj._ptr = ptr * return obj # <<<<<<<<<<<<<< @@ -9898,7 +9779,7 @@ static struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *__pyx_f_2wx_3svg_8_n __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "wx/svg/_nanosvg.pyx":555 + /* "wx/svg/_nanosvg.pyx":545 * * @staticmethod * cdef SVGgradientStop from_ptr(NSVGgradientStop *ptr): # <<<<<<<<<<<<<< @@ -9918,7 +9799,7 @@ static struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *__pyx_f_2wx_3svg_8_n return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":560 +/* "wx/svg/_nanosvg.pyx":550 * return obj * * def _check_ptr(self): # <<<<<<<<<<<<<< @@ -9947,7 +9828,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_2_check_ptr(struc PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_check_ptr", 0); - /* "wx/svg/_nanosvg.pyx":561 + /* "wx/svg/_nanosvg.pyx":551 * * def _check_ptr(self): * if self._ptr == NULL: # <<<<<<<<<<<<<< @@ -9957,20 +9838,20 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_2_check_ptr(struc __pyx_t_1 = ((__pyx_v_self->_ptr == NULL) != 0); if (unlikely(__pyx_t_1)) { - /* "wx/svg/_nanosvg.pyx":562 + /* "wx/svg/_nanosvg.pyx":552 * def _check_ptr(self): * if self._ptr == NULL: * raise ValueError("Invalid SVGgradientStop") # <<<<<<<<<<<<<< * * @property */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 562, __pyx_L1_error) + __PYX_ERR(0, 552, __pyx_L1_error) - /* "wx/svg/_nanosvg.pyx":561 + /* "wx/svg/_nanosvg.pyx":551 * * def _check_ptr(self): * if self._ptr == NULL: # <<<<<<<<<<<<<< @@ -9979,7 +9860,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_2_check_ptr(struc */ } - /* "wx/svg/_nanosvg.pyx":560 + /* "wx/svg/_nanosvg.pyx":550 * return obj * * def _check_ptr(self): # <<<<<<<<<<<<<< @@ -10000,7 +9881,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_2_check_ptr(struc return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":565 +/* "wx/svg/_nanosvg.pyx":555 * * @property * def color(self) -> uint: # <<<<<<<<<<<<<< @@ -10029,14 +9910,14 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_5color___get__(st PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "wx/svg/_nanosvg.pyx":566 + /* "wx/svg/_nanosvg.pyx":556 * @property * def color(self) -> uint: * self._check_ptr() # <<<<<<<<<<<<<< * return self._ptr.color * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_ptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_ptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -10050,12 +9931,12 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_5color___get__(st } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "wx/svg/_nanosvg.pyx":567 + /* "wx/svg/_nanosvg.pyx":557 * def color(self) -> uint: * self._check_ptr() * return self._ptr.color # <<<<<<<<<<<<<< @@ -10063,13 +9944,13 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_5color___get__(st * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_ptr->color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_ptr->color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "wx/svg/_nanosvg.pyx":565 + /* "wx/svg/_nanosvg.pyx":555 * * @property * def color(self) -> uint: # <<<<<<<<<<<<<< @@ -10090,7 +9971,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_5color___get__(st return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":570 +/* "wx/svg/_nanosvg.pyx":560 * * @property * def color_rgba(self) -> tuple: # <<<<<<<<<<<<<< @@ -10122,19 +10003,19 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_10color_rgba___ge PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "wx/svg/_nanosvg.pyx":572 + /* "wx/svg/_nanosvg.pyx":562 * def color_rgba(self) -> tuple: * """ Returns color as a RGBA tuple """ * c = self.color # <<<<<<<<<<<<<< * return ( c & 0xff, * (c >> 8) & 0xff, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = __pyx_t_1; __pyx_t_1 = 0; - /* "wx/svg/_nanosvg.pyx":573 + /* "wx/svg/_nanosvg.pyx":563 * """ Returns color as a RGBA tuple """ * c = self.color * return ( c & 0xff, # <<<<<<<<<<<<<< @@ -10142,56 +10023,56 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_10color_rgba___ge * (c >> 16) & 0xff, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_v_c, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_v_c, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "wx/svg/_nanosvg.pyx":574 + /* "wx/svg/_nanosvg.pyx":564 * c = self.color * return ( c & 0xff, * (c >> 8) & 0xff, # <<<<<<<<<<<<<< * (c >> 16) & 0xff, * (c >> 24) & 0xff) */ - __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_8, 8, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "wx/svg/_nanosvg.pyx":575 + /* "wx/svg/_nanosvg.pyx":565 * return ( c & 0xff, * (c >> 8) & 0xff, * (c >> 16) & 0xff, # <<<<<<<<<<<<<< * (c >> 24) & 0xff) * */ - __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_16, 16, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_16, 16, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "wx/svg/_nanosvg.pyx":576 + /* "wx/svg/_nanosvg.pyx":566 * (c >> 8) & 0xff, * (c >> 16) & 0xff, * (c >> 24) & 0xff) # <<<<<<<<<<<<<< * * @property */ - __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_24, 24, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RshiftObjC(__pyx_v_c, __pyx_int_24, 24, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AndObjC(__pyx_t_2, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "wx/svg/_nanosvg.pyx":573 + /* "wx/svg/_nanosvg.pyx":563 * """ Returns color as a RGBA tuple """ * c = self.color * return ( c & 0xff, # <<<<<<<<<<<<<< * (c >> 8) & 0xff, * (c >> 16) & 0xff, */ - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -10209,7 +10090,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_10color_rgba___ge __pyx_t_2 = 0; goto __pyx_L0; - /* "wx/svg/_nanosvg.pyx":570 + /* "wx/svg/_nanosvg.pyx":560 * * @property * def color_rgba(self) -> tuple: # <<<<<<<<<<<<<< @@ -10233,7 +10114,7 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_10color_rgba___ge return __pyx_r; } -/* "wx/svg/_nanosvg.pyx":579 +/* "wx/svg/_nanosvg.pyx":569 * * @property * def offset(self) -> float: # <<<<<<<<<<<<<< @@ -10262,14 +10143,14 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_6offset___get__(s PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); - /* "wx/svg/_nanosvg.pyx":580 + /* "wx/svg/_nanosvg.pyx":570 * @property * def offset(self) -> float: * self._check_ptr() # <<<<<<<<<<<<<< * return self._ptr.offset * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_ptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_ptr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -10283,12 +10164,12 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_6offset___get__(s } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "wx/svg/_nanosvg.pyx":581 + /* "wx/svg/_nanosvg.pyx":571 * def offset(self) -> float: * self._check_ptr() * return self._ptr.offset # <<<<<<<<<<<<<< @@ -10296,13 +10177,13 @@ static PyObject *__pyx_pf_2wx_3svg_8_nanosvg_15SVGgradientStop_6offset___get__(s * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_ptr->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_ptr->offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "wx/svg/_nanosvg.pyx":579 + /* "wx/svg/_nanosvg.pyx":569 * * @property * def offset(self) -> float: # <<<<<<<<<<<<<< @@ -12585,12 +12466,8 @@ static PyObject *__pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_linearPoints(PyO return __pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_12linearPoints_1__get__(o); } -static PyObject *__pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPoint(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_11radialPoint_1__get__(o); -} - -static PyObject *__pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPoint2(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_12radialPoint2_1__get__(o); +static PyObject *__pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPointRadius(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_2wx_3svg_8_nanosvg_11SVGgradient_17radialPointRadius_1__get__(o); } static PyMethodDef __pyx_methods_2wx_3svg_8_nanosvg_SVGgradient[] = { @@ -12607,8 +12484,7 @@ static struct PyGetSetDef __pyx_getsets_2wx_3svg_8_nanosvg_SVGgradient[] = { {(char *)"fy", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_fy, 0, (char *)0, 0}, {(char *)"stops", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_stops, 0, (char *)"\n A generator that iterates over the SVGgradientStops contained in the SVGgradient\n ", 0}, {(char *)"linearPoints", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_linearPoints, 0, (char *)"\n For linear gradients this returns the start and stop points as tuples\n of the form ((x1,y1), (x2,y2)).\n ", 0}, - {(char *)"radialPoint", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPoint, 0, (char *)0, 0}, - {(char *)"radialPoint2", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPoint2, 0, (char *)0, 0}, + {(char *)"radialPointRadius", __pyx_getprop_2wx_3svg_8_nanosvg_11SVGgradient_radialPointRadius, 0, (char *)"\n For radial gradients this returns the center point and the radius as a\n tuple of the form ((cx, cy), radius).\n ", 0}, {0, 0, 0, 0, 0} }; @@ -13590,14 +13466,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - /* "wx/svg/_nanosvg.pyx":562 + /* "wx/svg/_nanosvg.pyx":552 * def _check_ptr(self): * if self._ptr == NULL: * raise ValueError("Invalid SVGgradientStop") # <<<<<<<<<<<<<< * * @property */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Invalid_SVGgradientStop); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Invalid_SVGgradientStop); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); @@ -13821,16 +13697,16 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_2wx_3svg_8_nanosvg_SVGgradient = &__pyx_type_2wx_3svg_8_nanosvg_SVGgradient; __pyx_vtabptr_2wx_3svg_8_nanosvg_SVGgradientStop = &__pyx_vtable_2wx_3svg_8_nanosvg_SVGgradientStop; __pyx_vtable_2wx_3svg_8_nanosvg_SVGgradientStop.from_ptr = (struct __pyx_obj_2wx_3svg_8_nanosvg_SVGgradientStop *(*)(NSVGgradientStop *))__pyx_f_2wx_3svg_8_nanosvg_15SVGgradientStop_from_ptr; - if (PyType_Ready(&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 536, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_dictoffset && __pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (__Pyx_SetVtable(__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_dict, __pyx_vtabptr_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 546, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SVGgradientStop, (PyObject *)&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 546, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop.tp_dict, __pyx_vtabptr_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SVGgradientStop, (PyObject *)&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop) < 0) __PYX_ERR(0, 536, __pyx_L1_error) __pyx_ptype_2wx_3svg_8_nanosvg_SVGgradientStop = &__pyx_type_2wx_3svg_8_nanosvg_SVGgradientStop; if (PyType_Ready(&__pyx_type_2wx_3svg_8_nanosvg___pyx_scope_struct____get__) < 0) __PYX_ERR(0, 162, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 diff --git a/wx/svg/_nanosvg.pyx b/wx/svg/_nanosvg.pyx index 55c2c4af..3331a0c5 100644 --- a/wx/svg/_nanosvg.pyx +++ b/wx/svg/_nanosvg.pyx @@ -514,18 +514,21 @@ cdef class SVGgradient: return ((x1,y1), (x2,y2)) @property - def radialPoint(self): + def radialPointRadius(self) -> tuple: + """ + For radial gradients this returns the center point and the radius as a + tuple of the form ((cx, cy), radius). + """ cdef float inverse[6] cdef float cx, cy, radius cdef float r1, r2 - nsvg__xformInverse(inverse, self._ptr.xform) nsvg__xformPoint(&cx, &cy, 0, 0, inverse) nsvg__xformPoint(&r1, &r2, 0, 1, inverse) - radius = r2 - cy + radius = r2 - r1 - return (cx, cy, radius) + return ((cx, cy), radius)