Re: Qahirah: A High-Level Cairo API Binding For Python 3
Dan Raymond <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
On 3/11/2015 5:09 PM, Lawrence D'Oliveiro wrote: > Besides, I think my version has fewer statements than yours. Remember > that > > (qah.Context(tile) > .set_matrix(Matrix.scale(pattern_res) * Matrix.translate(- path_bounds.topleft)) > .set_source_colour(Colour.grey(1)) > .set_operator(CAIRO.OPERATOR_SOURCE) > .paint() > .set_source_colour(Colour.grey(0)) > .new_path() > .append_path(shape) > # need enough copies to cover neighbouring spots under all possible pattern parameters > .append_path(shape.transform(Matrix.translate(tips[2] - tips[1]))) > .append_path(shape.transform(Matrix.translate(tips[0] - tips[1]))) > .append_path(shape.transform(Matrix.translate((+ pattern_dimensions.x, 0)))) > .append_path(shape.transform(Matrix.translate((- pattern_dimensions.x, 0)))) > .append_path(shape.transform(Matrix.translate(tips[1] - tips[2]))) > .append_path(shape.transform(Matrix.translate(tips[1] - tips[0]))) > .fill() > ) > > is technically one Python statement. LOL, I don't think anything more needs to be said. -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo