diff options
Diffstat (limited to 'generic/Transfo.c')
-rw-r--r-- | generic/Transfo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/Transfo.c b/generic/Transfo.c index 6c1c408..1395c17 100644 --- a/generic/Transfo.c +++ b/generic/Transfo.c @@ -194,7 +194,12 @@ ZnTransfoIsIdentity(ZnTransfo *t) void ZnTransfoSetIdentity(ZnTransfo *t) { - *t = ((ZnTransfo) {{{1, 0}, {0, 1}, {0, 0}}}); + t->_[0][0] = 1; + t->_[0][1] = 0; + t->_[1][0] = 0; + t->_[1][1] = 1; + t->_[2][0] = 0; + t->_[2][1] = 0; } @@ -563,13 +568,13 @@ void ZnTransformPoints(ZnTransfo *t, ZnPoint *p, ZnPoint *xp, - int num) + unsigned int num) { if (t == NULL) { memcpy(xp, p, sizeof(ZnPoint)*num); } else { - int i; + unsigned int i; for (i = 0; i < num; i++) { xp[i].x = t->_[0][0]*p[i].x + t->_[1][0]*p[i].y + t->_[2][0]; @@ -686,7 +691,7 @@ ZnTransfo * ZnRotateDeg(ZnTransfo *t, ZnReal angle) { - return ZnRotateRad(t, DegreesToRadian(angle)); + return ZnRotateRad(t, ZnDegRad(angle)); } |