Browse Source

Increase image copy margin

Tomas Farago 9 years ago
parent
commit
7ff805dae2
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/ufo-anka-backproject-task.c

+ 3 - 2
src/ufo-anka-backproject-task.c

@@ -147,7 +147,8 @@ determine_x_extrema (gfloat extrema[2], GValueArray *x_extrema, GValueArray *y_e
         swap (&x_min, &x_max);
     }
 
-    extrema[0] = cos_tomo * x_min + sin_tomo * y_min + x_center;
+    /* -1 to make sure the interpolation doesn't reach to uninitialized values*/
+    extrema[0] = cos_tomo * x_min + sin_tomo * y_min + x_center - 1;
     /* +1 because extrema[1] will be accessed by interpolation
      * but the region in copying is right-open */
     extrema[1] = cos_tomo * x_max + sin_tomo * y_max + x_center + 1;
@@ -183,7 +184,7 @@ determine_y_extrema (gfloat extrema[2], GValueArray *x_extrema, GValueArray *y_e
 
     extrema[0] = sin_tomo * x_min - cos_tomo * y_min;
     extrema[1] = sin_tomo * x_max - cos_tomo * y_max;
-    extrema[0] = extrema[0] * cos_lamino + z_extrema[0] * sin_lamino + y_center;
+    extrema[0] = extrema[0] * cos_lamino + z_extrema[0] * sin_lamino + y_center - 1;
     extrema[1] = extrema[1] * cos_lamino + z_extrema[1] * sin_lamino + y_center + 1;
 }