aboutsummaryrefslogtreecommitdiff
path: root/generic/Transfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Transfo.c')
-rw-r--r--generic/Transfo.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/generic/Transfo.c b/generic/Transfo.c
index 2d9b59f..b8f4fb5 100644
--- a/generic/Transfo.c
+++ b/generic/Transfo.c
@@ -610,37 +610,29 @@ ZnTransformPoints(ZnTransfo *t,
*
* ZnTranslate --
* Translate the given transformation by delta_x, delta_y. Returns
- * the resulting transformation.
- *
- * ZnSetTranslation --
- * Set the translation instead of combining it into the
- * transformation.
+ * the resulting transformation. If abs is true, delta_x and
+ * delta_y are used to set the translation instead of adding deltas.
*
*************************************************************************
*/
ZnTransfo *
ZnTranslate(ZnTransfo *t,
ZnReal delta_x,
- ZnReal delta_y)
-{
- t->_[2][0] = t->_[2][0] + delta_x;
- t->_[2][1] = t->_[2][1] + delta_y;
-
- return t;
-}
-
-ZnTransfo *
-ZnSetTranslation(ZnTransfo *t,
- ZnReal delta_x,
- ZnReal delta_y)
+ ZnReal delta_y,
+ ZnBool abs)
{
- t->_[2][0] = delta_x;
- t->_[2][1] = delta_y;
+ if (abs) {
+ t->_[2][0] = delta_x;
+ t->_[2][1] = delta_y;
+ }
+ else {
+ t->_[2][0] = t->_[2][0] + delta_x;
+ t->_[2][1] = t->_[2][1] + delta_y;
+ }
return t;
}
-
/*
*************************************************************************
*