[PATCH] Fix rect position when trasnforming to view coordinates

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

 



Hello,

I sent attached to this letter a patch to view-helper's
model_rect_to_view_rect() function that computes the position of view
rectangle correctly--instead of subtracting the rectangle's coordinate
from the scaled position, it subtracts the widget's position.

With this patch, gegl-gtk-paint works better.


Regards,

Jordi
>From 3607b30dacc6582a30b356708fd837d64c0fb0c1 Mon Sep 17 00:00:00 2001
From: Jordi Fita <jfita@xxxxxxxxxxxxxxxxx>
Date: Sun, 6 May 2012 13:28:54 +0200
Subject: [PATCH] Fixed rect pos in model_rect_to_view_rect

---
 gegl-gtk/internal/view-helper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gegl-gtk/internal/view-helper.c b/gegl-gtk/internal/view-helper.c
index 44182bc..a770418 100644
--- a/gegl-gtk/internal/view-helper.c
+++ b/gegl-gtk/internal/view-helper.c
@@ -106,8 +106,8 @@ model_rect_to_view_rect(ViewHelper *self, GeglRectangle *rect)
 {
     GeglRectangle temp;
 
-    temp.x = self->scale * (rect->x) - rect->x;
-    temp.y = self->scale * (rect->y) - rect->y;
+    temp.x = self->scale * (rect->x) - self->x;
+    temp.y = self->scale * (rect->y) - self->y;
     temp.width = ceil(self->scale * rect->width);
     temp.height = ceil(self->scale * rect->height);
 
-- 
1.7.3.4

_______________________________________________
gegl-developer-list mailing list
gegl-developer-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gegl-developer-list

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux