[dia] [transform] don't change image size to simulate rotation



commit 4c01794c872d73c4f2f3d05cb43c659206340ea4
Author: Hans Breuer <hans breuer org>
Date:   Sat Oct 18 15:44:19 2014 +0200

    [transform] don't change image size to simulate rotation
    
    still missing the capability to actually rotate the pixels.

 lib/diatransformrenderer.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/lib/diatransformrenderer.c b/lib/diatransformrenderer.c
index e129dce..f48a24b 100644
--- a/lib/diatransformrenderer.c
+++ b/lib/diatransformrenderer.c
@@ -472,26 +472,18 @@ draw_image(DiaRenderer *self,
           DiaImage *image)
 {
   Point p1 = *point;
-  Point p2 = p1;
+  Point pc = p1;
   DiaTransformRenderer *renderer = DIA_TRANSFORM_RENDERER (self);
   DiaMatrix *m = g_queue_peek_tail (renderer->matrices);
   g_return_if_fail (renderer->worker != NULL);
 
   /* ToDo: some support on the library level? */
-  p2.x += width;
-  p2.y += height;
+  pc.x += width/2.0;
+  pc.y += height/2.0;
   if (m) {
-    transform_point (&p1, m);
-    transform_point (&p2, m);
-    /* don't reduce to negative */
-    if (p2.x > p1.x)
-      width = p2.x - p1.x;
-    else
-      width = p1.x - p2.x;
-    if (p2.y > p1.y)
-      height = p2.y - p1.y;
-    else
-      height = p1.y - p2.y;
+    transform_point (&pc, m);
+    p1.x = pc.x - width/2.0;
+    p1.y = pc.y - height/2.0;
   }
   /* FIXME: for now only the position is transformed */
   DIA_RENDERER_GET_CLASS (renderer->worker)->draw_image (renderer->worker, &p1, width, height, image);


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