ssimms / pdfapi2

Create, modify, and examine PDF files in Perl
Other
15 stars 20 forks source link

PDF::API2::Content::stroke_color (and fill_color): documentation implies they return "self" (i.e. to chain), but they don't #74

Closed vadim-160102 closed 7 months ago

vadim-160102 commented 7 months ago

These methods are coded as setters/getters, but it would be nice if they could be chained with most other methods, as per the POD. In fact I'm not sure when a "getter" would be useful. There seem to be no other "getters" e.g. for line_width, etc.

Also, related, i.e. in the same module, end is grouped into "PATH CONSTRUCTION" category, while it's painting no-op (e.g. see where its description is placed in the Reference); and perhaps it would be worth to document, that

$content = $content->clip(rule => $rule)->end;

is its only practically useful idiom.

ssimms commented 7 months ago

These methods are coded as setters/getters, but it would be nice if they could be chained with most other methods, as per the POD. In fact I'm not sure when a "getter" would be useful. There seem to be no other "getters" e.g. for line_width, etc.

I've updated the POD so they're no longer listed as being chainable. Changing them to be chainable would break backward compatibility, so I'm not eager to do that.

Also, related, i.e. in the same module, end is grouped into "PATH CONSTRUCTION" category, while it's painting no-op (e.g. see where its description is placed in the Reference)

I've moved it to the correct section and expanded the POD slightly. Thanks.