jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.29k stars 772 forks source link

Extends support for rounded rectangles #332

Closed benoitkugler closed 4 years ago

benoitkugler commented 4 years ago

Hi ! This PR extends the support for rounded rectangles by allowing different radius for each corner. Two public methods are added : RoundedRect2() and ClipRoundedRect2() It also rewrites the underlying code : the logic shared between both methods is extracted in roundedRectPath(), to avoid code duplication.

Any comments are welcomed; in particular, the names of the new methods could probably be more explicit.

Thanks in advance for the review ! Benoit K.

jung-kurt commented 4 years ago

Thanks, @benoitkugler -- nice addition!