250
250
the current coordinate matrix.
252
252
cdef float a,b,c,d,tx,ty
255
(tx, ty, _)) = transform
253
a,b,c,d,tx,ty = transform
257
255
cdef CGAffineTransform atransform
258
256
atransform = CGAffineTransformMake(a,b,c,d,tx,ty)
1060
1058
CGContextDrawPath(self.context, cg_mode)
1061
1059
CGContextRestoreGState(self.context)
1063
def linear_gradient(self, x1, y1, x2, y2, stops, spread_method):
1061
def linear_gradient(self, x1, y1, x2, y2, stops, spread_method, units='userSpaceOnUse'):
1064
1063
stops_list = stops.transpose().tolist()
1065
1064
func = PiecewiseLinearColorFunction(stops_list)
1066
1065
shading = AxialShading(func, (x1,y1), (x2,y2),
1067
1066
extend_start=1, extend_end=1)
1068
1067
self.draw_shading(shading)
1070
def radial_gradient(self, cx, cy, r, fx, fy, stops, spread_method):
1069
def radial_gradient(self, cx, cy, r, fx, fy, stops, spread_method, units='userSpaceOnUse'):
1071
1071
stops_list = stops.transpose().tolist()
1072
1072
func = PiecewiseLinearColorFunction(stops_list)
1073
1073
shading = RadialShading(func, (fx, fy), 0.0, (cx, cy), r,