diff --git a/cuburn/code/iter.py b/cuburn/code/iter.py index fb837c6..f444bff 100644 --- a/cuburn/code/iter.py +++ b/cuburn/code/iter.py @@ -118,6 +118,10 @@ void apply_xf{{xfid}}(float &ox, float &oy, float &color, mwc_st &rctx) { } {{endfor}} + {{if xform.has_post}} + tx = ox; + ty = oy; + {{apply_affine_flam3('tx', 'ty', 'ox', 'oy', px, 'xf.post', 'post')}} {{endif}} float csp = {{px.get('xf.color_speed')}}; diff --git a/cuburn/render.py b/cuburn/render.py index 13a591b..717a24e 100644 --- a/cuburn/render.py +++ b/cuburn/render.py @@ -458,9 +458,15 @@ class XFormFeatures(object): def __init__(self, xforms, xform_id): self.id = xform_id any = lambda l: bool(filter(None, map(l, xforms))) - self.has_post = any(lambda xf: getattr(xf, 'post', None)) + + self.has_post = any(lambda xf: not self.id_matrix(xf.post)) self.vars = set() for x in xforms: self.vars = ( self.vars.union(set([i for i, v in enumerate(x.var) if v]))) + @staticmethod + def id_matrix(m): + return (m[0][0] == 1 and m[1][0] == 0 and m[2][0] == 0 and + m[0][1] == 0 and m[1][1] == 1 and m[2][1] == 0) +