gimp r28029 - in trunk: . app/core
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r28029 - in trunk: . app/core
- Date: Sat, 14 Feb 2009 12:48:12 +0000 (UTC)
Author: neo
Date: Sat Feb 14 12:48:12 2009
New Revision: 28029
URL: http://svn.gnome.org/viewvc/gimp?rev=28029&view=rev
Log:
2009-02-14 Sven Neumann <sven gimp org>
Bug 472644 â Rotate with clipping crops the whole layer
* app/core/gimp-transform-resize.c: applied patch as attached to
bug #472644. Supposedly fixes the problem of the disappearing
image.
Modified:
trunk/ChangeLog
trunk/app/core/gimp-transform-resize.c
Modified: trunk/app/core/gimp-transform-resize.c
==============================================================================
--- trunk/app/core/gimp-transform-resize.c (original)
+++ trunk/app/core/gimp-transform-resize.c Sat Feb 14 12:48:12 2009
@@ -234,38 +234,38 @@
{
Point points[4];
Rectangle r;
- gint ax, ay, tx, ty;
+ Point t,a;
gint i, j;
gint min;
/* fill in the points array */
- points[0].x = floor (dx1);
- points[0].y = floor (dy1);
- points[1].x = floor (dx2);
- points[1].y = floor (dy2);
- points[2].x = floor (dx3);
- points[2].y = floor (dy3);
- points[3].x = floor (dx4);
- points[3].y = floor (dy4);
+ points[0].x = dx1;
+ points[0].y = dy1;
+ points[1].x = dx2;
+ points[1].y = dy2;
+ points[2].x = dx3;
+ points[2].y = dy3;
+ points[3].x = dx4;
+ points[3].y = dy4;
/* first, translate the vertices into the first quadrant */
- ax = 0;
- ay = 0;
+ a.x = 0;
+ a.y = 0;
for (i = 0; i < 4; i++)
{
- if (points[i].x < ax)
- ax = points[i].x;
+ if (points[i].x < a.x)
+ a.x = points[i].x;
- if (points[i].y < ay)
- ay = points[i].y;
+ if (points[i].y < a.y)
+ a.y = points[i].y;
}
for (i = 0; i < 4; i++)
{
- points[i].x += (-ax) * 2;
- points[i].y += (-ay) * 2;
+ points[i].x += (-a.x) * 2;
+ points[i].y += (-a.y) * 2;
}
@@ -280,14 +280,9 @@
min = i;
}
- tx = points[0].x;
- ty = points[0].y;
-
- points[0].x = points[min].x;
- points[0].y = points[min].y;
-
- points[min].x = tx;
- points[min].y = ty;
+ t = points[0];
+ points[0] = points[min];
+ points[min] = t;
for (i = 1; i < 4; i++)
{
@@ -313,35 +308,22 @@
theta_v = theta_m;
- tx = points[i].x;
- ty = points[i].y;
-
- points[i].x = points[min].x;
- points[i].y = points[min].y;
-
- points[min].x = tx;
- points[min].y = ty;
+ t = points[i];
+ points[i] = points[min];
+ points[min] = t;
}
/* reverse the order of points */
- tx = points[0].x;
- ty = points[0].y;
-
- points[0].x = points[3].x;
- points[0].y = points[3].y;
- points[3].x = tx;
- points[3].y = ty;
-
- tx = points[1].x;
- ty = points[1].y;
-
- points[1].x = points[2].x;
- points[1].y = points[2].y;
- points[2].x = tx;
- points[2].y = ty;
+ t = points[0];
+ points[0] = points[3];
+ points[3] = t;
+
+ t = points[1];
+ points[1] = points[2];
+ points[2] = t;
- r.a.x = r.a.y = r.b.x = r.b.y = r.c.x = r.c.x = r.d.x = r.d.x = r.area = 0;
+ r.a.x = r.a.y = r.b.x = r.b.y = r.c.x = r.c.y = r.d.x = r.d.y = r.area = 0;
r.aspect = aspect;
if (aspect != 0)
@@ -365,10 +347,10 @@
*x2 = ceil (r.c.x - 0.5);
*y2 = ceil (r.c.y - 0.5);
- *x1 = *x1 - ((-ax) * 2);
- *y1 = *y1 - ((-ay) * 2);
- *x2 = *x2 - ((-ax) * 2);
- *y2 = *y2 - ((-ay) * 2);
+ *x1 = *x1 - ((-a.x) * 2);
+ *y1 = *y1 - ((-a.y) * 2);
+ *x2 = *x2 - ((-a.x) * 2);
+ *y2 = *y2 - ((-a.y) * 2);
}
@@ -379,31 +361,31 @@
{
Point a = points[p % 4]; /* 0 1 2 3 */
Point b = points[(p + 1) % 4]; /* 1 2 3 0 */
- Point c = points[(p + 2) % 4]; /* 2 3 0 2 */
- Point d = points[(p + 3) % 4]; /* 3 0 1 1 */
+ Point c = points[(p + 2) % 4]; /* 2 3 0 1 */
+ Point d = points[(p + 3) % 4]; /* 3 0 1 2 */
Point i1; /* intersection point */
Point i2; /* intersection point */
Point i3; /* intersection point */
- if (intersect_x (b, c, a, &i1) &&
- intersect_y (c, d, i1, &i2) &&
- intersect_x (d, a, i2, &i3))
+ if (intersect_x (b, c, a, &i1) &&
+ intersect_y (c, d, i1, &i2) &&
+ intersect_x (d, a, i2, &i3))
+ add_rectangle (points, r, i3, i3, i1, i1);
+
+ if (intersect_y (b, c, a, &i1) &&
+ intersect_x (c, d, i1, &i2) &&
+ intersect_y (d, a, i2, &i3))
add_rectangle (points, r, i3, i3, i1, i1);
- if (intersect_y (b, c, a, &i1) &&
- intersect_x (c, d, i1, &i2) &&
- intersect_y (a, i1, i2, &i3))
- add_rectangle (points, r, i3, i3, i1, i2);
-
- if (intersect_x (c, d, a, &i1) &&
- intersect_y (b, c, i1, &i2) &&
- intersect_x (a, i1, i2, &i3))
- add_rectangle (points, r, i3, i3, i1, i2);
-
- if (intersect_y (c, d, a, &i1) &&
- intersect_x (b, c, i1, &i2) &&
- intersect_y (a, i1, i2, &i3))
- add_rectangle (points, r, i3, i3, i1, i2);
+ if (intersect_x (d, c, a, &i1) &&
+ intersect_y (c, b, i1, &i2) &&
+ intersect_x (b, a, i2, &i3))
+ add_rectangle (points, r, i3, i3, i1, i1);
+
+ if (intersect_y (d, c, a, &i1) &&
+ intersect_x (c, b, i1, &i2) &&
+ intersect_y (b, a, i2, &i3))
+ add_rectangle (points, r, i3, i3, i1, i1);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]