Ejemplo n.º 1
0
    def __init__(self, t, ct, objectId, depth, name, clipDepth):
        super(Place, self).__init__()

        self.id = objectId
        self.depth = depth
        self.swf_depth = 1
        self.clipDepth = clipDepth 
        self.name = name
        self.visible = True
        self.symbols = []

        self.sx = None
        self.sy = None
        self.wx = None
        self.wy = None
        self.tx = None
        self.ty = None

        if len(t) > 0:
            self.sx,self.sy,self.wx,self.wy,self.tx,self.ty=tuple(LUtil.get_values_as_float(t[0],'scaleX','scaleY','skewX','skewY','transX','transY'))

        self.ctf = []

        if len(ct) > 0:
            factors = LUtil.get_colortrans(ct[0], 'factor')
            offsets = LUtil.get_colortrans(ct[0], 'offset')

            self.ctf = factors + offsets
Ejemplo n.º 2
0
    def _get_styles_gradient(self, e, objectId):
        stops = []
        gclr = e.find('gradientColors')
        for gc in list(gclr):
            position = gc.get('position')
            c = gc.find('color/Color')
            color = LUtil.get_colortrans(c)
            stop = Stop(color, position)
            stops.append(stop)

        gtf = e.find('matrix/Transform')
        linearGrad = LinearGradient(objectId, gtf, stops)

        return linearGrad