[dia] group_create_with_matrix() - special handling for translate



commit 886f036354dadf982de0656ac602153e3122e423
Author: Hans Breuer <hans breuer org>
Date:   Sat Sep 18 18:30:05 2010 +0200

    group_create_with_matrix() - special handling for translate
    
    Use m->x0 and m->y0 to shift the objects in the group and adapt
    the passed in matrix accordingly. This is necessary because the
    translation part of the matrix will get used internally later on.

 lib/group.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lib/group.c b/lib/group.c
index 6677829..dc05980 100644
--- a/lib/group.c
+++ b/lib/group.c
@@ -453,6 +453,11 @@ DiaObject *
 group_create_with_matrix(GList *objects, DiaMatrix *matrix)
 {
   Group *group = (Group *)group_create(objects);
+  if (matrix->x0 != 0 || matrix->y0 != 0) {
+    Point delta = {matrix->x0, matrix->y0};
+    matrix->x0 = matrix->y0 = 0; /* offset used internally */
+    object_list_move_delta(group->objects, &delta);
+  }
   group->matrix = matrix;
   group_update_data(group);
   return &group->object;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]