diff options
author | Alex Merry <alex.merry@cs.ox.ac.uk> | 2012-05-24 12:36:48 +0100 |
---|---|---|
committer | Alex Merry <alex.merry@cs.ox.ac.uk> | 2012-05-24 12:36:48 +0100 |
commit | 7edfc757be29bd29111b898dfc87fb1b258920a3 (patch) | |
tree | 9a8f2ab2f285999316570236df321baaf39324da /tikzit/src/common/RegularPolyShape.h | |
parent | 5dcbea7d268bf1be9548226665bce6a24e2e9d55 (diff) |
Fix RegularPolyShape rotation to match TikZ
In PGF/TikZ, regular polygons with rotation 0 have a side flat at the
bottom. RegularPolyShape now does the same, and also takes its
rotation in degrees.
Diffstat (limited to 'tikzit/src/common/RegularPolyShape.h')
-rw-r--r-- | tikzit/src/common/RegularPolyShape.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tikzit/src/common/RegularPolyShape.h b/tikzit/src/common/RegularPolyShape.h index 663561e..1fd8f1e 100644 --- a/tikzit/src/common/RegularPolyShape.h +++ b/tikzit/src/common/RegularPolyShape.h @@ -24,10 +24,26 @@ #import <Foundation/Foundation.h> #import "Shape.h" +/** + * A regular polygon + * + * Matches the "regular polygon" shape in the shapes.geometric + * PGF/TikZ library. + */ @interface RegularPolyShape : Shape { } -- (id)initWithSides:(int)s rotation:(float)r; +/** + * Initialise a regular polygon + * + * A rotation of 0 will produce a polygon with one + * edge flat along the bottom (just like PGF/TikZ + * does it). + * + * @param sides the number of sides the polygon should have + * @param rotation the rotation of the polygon, in degrees + */ +- (id)initWithSides:(int)sides rotation:(int)rotation; @end |