Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 11999)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 12000)
@@ -7,6 +7,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2007-02-22 22:12:36 $
+/// @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2007-02-22 22:36:21 $
 ///
 /// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -125,10 +125,13 @@
     int xMin, xMax, yMin, yMax;         // Range of values for kernel
     int xLast, yLast;                   // Last location, for relative shifts
+    int x0, y0;                         // Final location; everything is relative to this
     xLast = xMin = xMax = xShifts->data.S32[0];
     yLast = yMin = yMax = yShifts->data.S32[0];
-    float tSum = tShifts->data.F32[0];   // Sum of the times
+    x0 = xShifts->data.S32[num - 1];
+    y0 = yShifts->data.S32[num - 1];
+    float tSum = tShifts->data.F32[num];   // Sum of the times
     for (long i = 1; i < num; i++) {
-        int x = xShifts->data.S32[i];    // x position in kernel
-        int y = yShifts->data.S32[i];    // y position in kernel
+        int x = xShifts->data.S32[i] - x0; // x position in kernel
+        int y = yShifts->data.S32[i] - y0; // y position in kernel
         if (xyRelative) {
             x += xLast;
@@ -169,6 +172,6 @@
     float tLast = 0.0;                  // Last value for t
     for (int i = 0; i < num; i++) {
-        int x = xShifts->data.S32[i];    // x position in kernel
-        int y = yShifts->data.S32[i];    // y position in kernel
+        int x = xShifts->data.S32[i] - x0; // x position in kernel
+        int y = yShifts->data.S32[i] - y0; // y position in kernel
         if (xyRelative) {
             x += xLast;
