summaryrefslogtreecommitdiff
path: root/tikzit/src/common/util.m
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2012-05-24 12:36:48 +0100
committerAlex Merry <alex.merry@cs.ox.ac.uk>2012-05-24 12:36:48 +0100
commit7edfc757be29bd29111b898dfc87fb1b258920a3 (patch)
tree9a8f2ab2f285999316570236df321baaf39324da /tikzit/src/common/util.m
parent5dcbea7d268bf1be9548226665bce6a24e2e9d55 (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/util.m')
-rw-r--r--tikzit/src/common/util.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/tikzit/src/common/util.m b/tikzit/src/common/util.m
index ad04a96..762516f 100644
--- a/tikzit/src/common/util.m
+++ b/tikzit/src/common/util.m
@@ -310,6 +310,10 @@ float radiansToDegrees (float radians) {
return (radians * 180.0f) / M_PI;
}
+float degreesToRadians(float degrees) {
+ return (degrees * M_PI) / 180.0f;
+}
+
int normaliseAngleDeg (int degrees) {
while (degrees > 180) {
degrees -= 360;