~ubuntu-branches/ubuntu/trusty/python-enable/trusty-proposed

« back to all changes in this revision

Viewing changes to enthought/kiva/mac/ABCGI.pyx

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-02-28 14:56:36 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100228145636-9ghfhe3uy37tt3q6
Tags: 3.3.0-1
* New upstream release
* Bump Standards-Version to 3.8.4
* Switch to source format 3.0
* Update patches/freetype2.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
                                       the current coordinate matrix.
251
251
        """
252
252
        cdef float a,b,c,d,tx,ty
253
 
        ((a, b, _),
254
 
         (c, d, _),
255
 
         (tx, ty, _)) = transform
 
253
        a,b,c,d,tx,ty = transform
256
254
 
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)
1062
1060
            
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'):
 
1062
        self.clip()           
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)
1069
1068
            
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'):
 
1070
        self.clip()           
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,