summaryrefslogtreecommitdiff
path: root/community/gimp-refocus/refocus-mirror-fix.patch
blob: af79dd89321cf5d07f49d3c0ed9a87a699c2fd63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Index: src/tilebuf.c
===================================================================
RCS file: /cvsroot/refocus/refocus/src/tilebuf.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 tilebuf.c
--- src/tilebuf.c	30 Jan 2003 21:30:19 -0000	1.1.1.1
+++ src/tilebuf.c	6 Apr 2004 20:26:56 -0000
@@ -140,7 +140,10 @@
 
         for (x = x_lo - 1; x >= buf->real_x; x--)
           {
-            copy_col (buf, 2 * x_lo - x, y_start, y_end - y_start, x);
+            gint sx = 2 * x_lo - x;
+            copy_col (buf,
+                      sx<=buf->real_x+buf->real_width-1?sx:buf->real_x+buf->real_width-1,
+                      y_start, y_end - y_start, x);
           };
       }
       break;
@@ -171,7 +174,9 @@
 
         for (x = x_hi; x < buf->real_x + buf->real_width; x++)
           {
-            copy_col (buf, 2 * (x_hi - 1) - x, y_start, y_end - y_start, x);
+            gint sx = 2 * (x_hi - 1) - x;
+            copy_col (buf, sx>=buf->real_x?sx:buf->real_x,
+                      y_start, y_end - y_start, x);
           };
       }
       break;
@@ -200,7 +205,10 @@
 
         for (y = y_lo - 1; y >= buf->real_y; y--)
           {
-            copy_row (buf, buf->real_x, 2 * y_lo - y, buf->real_width, y);
+            gint sy = 2 * y_lo - y;
+            copy_row (buf, buf->real_x,
+                      sy<=buf->real_y+buf->real_height-1?sy:buf->real_y+buf->real_height-1,
+                      buf->real_width, y);
           };
       }
       break;
@@ -230,8 +238,9 @@
 
         for (y = y_hi; y < buf->real_y + buf->real_height; y++)
           {
-            copy_row (buf, buf->real_x, 2 * (y_hi - 1) - y, buf->real_width,
-                      y);
+            gint sy = 2 * (y_hi - 1) - y;
+            copy_row (buf, buf->real_x, sy>=buf->real_y?sy:buf->real_y,
+                      buf->real_width, y);
           };
       }
       break;