more tweaking around with radial gradients

This commit is contained in:
Robin Dunn
2019-07-28 00:42:30 -07:00
parent 68357daec7
commit ce4a4d96d8
2 changed files with 107 additions and 228 deletions

View File

@@ -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)