def _render_closure(self):
fillcolor = self.fill<EOL>strokecolor = self.stroke<EOL>strokewidth = self.strokewidth<EOL>def _render(cairo_ctx):<EOL><INDENT>'''<STR_LIT>'''<EOL>transform = self._call_transform_mode(self._transform)<EOL>if fillcolor is None and strokecolor is None:<EOL><INDENT>return<EOL><DEDENT>cairo_ctx.set_matrix(transform)<EOL>self._traverse(cairo_ctx)<EOL>cairo_ctx.set_matrix(cairo.Matrix())<EOL>if fillcolor is not None and strokecolor is not None:<EOL><INDENT>if strokecolor[<NUM_LIT:3>] < <NUM_LIT:1>:<EOL><INDENT>cairo_ctx.push_group()<EOL>cairo_ctx.set_source_rgba(*fillcolor)<EOL>cairo_ctx.fill_preserve()<EOL>e = cairo_ctx.stroke_extents()<EOL>cairo_ctx.set_source_rgba(*strokecolor)<EOL>cairo_ctx.set_operator(cairo.OPERATOR_SOURCE)<EOL>cairo_ctx.set_line_width(strokewidth)<EOL>cairo_ctx.stroke()<EOL>cairo_ctx.pop_group_to_source()<EOL>cairo_ctx.paint()<EOL><DEDENT>else:<EOL><INDENT>cairo_ctx.set_source_rgba(*fillcolor)<EOL>cairo_ctx.fill_preserve()<EOL>cairo_ctx.set_source_rgba(*strokecolor)<EOL>cairo_ctx.set_line_width(strokewidth)<EOL>cairo_ctx.stroke()<EOL><DEDENT><DEDENT>elif fillcolor is not None:<EOL><INDENT>cairo_ctx.set_source_rgba(*fillcolor)<EOL>cairo_ctx.fill()<EOL><DEDENT>elif strokecolor is not None:<EOL><INDENT>cairo_ctx.set_source_rgba(*strokecolor)<EOL>cairo_ctx.set_line_width(strokewidth)<EOL>cairo_ctx.stroke()<EOL><DEDENT><DEDENT>return _render<EOL>
Use a closure so that draw attributes can be saved