def paint_single_path(self, gstate, stroke, fill, evenodd, path):
if len(path) < <NUM_LIT:2>:<EOL><INDENT>return<EOL><DEDENT>shape = "<STR_LIT>".join(x[<NUM_LIT:0>] for x in path)<EOL>pts = []<EOL>for p in path:<EOL><INDENT>for i in range(<NUM_LIT:1>, len(p), <NUM_LIT:2>):<EOL><INDENT>pts.append(apply_matrix_pt(self.ctm, (p[i], p[i + <NUM_LIT:1>])))<EOL><DEDENT><DEDENT>if self.line_only_shape.match(shape):<EOL><INDENT>has_slope = False<EOL>for i in range(len(pts) - <NUM_LIT:1>):<EOL><INDENT>if pts[i][<NUM_LIT:0>] != pts[i + <NUM_LIT:1>][<NUM_LIT:0>] and pts[i][<NUM_LIT:1>] != pts[i + <NUM_LIT:1>][<NUM_LIT:1>]:<EOL><INDENT>has_slope = True<EOL>break<EOL><DEDENT><DEDENT>if not has_slope:<EOL><INDENT>for i in range(len(pts) - <NUM_LIT:1>):<EOL><INDENT>self.cur_item.add(LTLine(gstate.linewidth, pts[i], pts[i + <NUM_LIT:1>]))<EOL><DEDENT>if shape.endswith("<STR_LIT:h>"):<EOL><INDENT>self.cur_item.add(LTLine(gstate.linewidth, pts[<NUM_LIT:0>], pts[-<NUM_LIT:1>]))<EOL><DEDENT>return<EOL><DEDENT><DEDENT>self.cur_item.add(LTCurve(gstate.linewidth, pts))<EOL>
Converting a single path draw command into lines and curves objects