[Bf-blender-cvs] [20db29bf2f8] temp-T101739-fix-seam-bleeding-non-manifold: Fix incorrect search bounds when looking for second source.

Jeroen Bakker noreply at git.blender.org
Tue Jan 17 12:49:08 CET 2023


Commit: 20db29bf2f852ffe196a3f554a373010d3e8f62d
Author: Jeroen Bakker
Date:   Tue Jan 17 12:48:34 2023 +0100
Branches: temp-T101739-fix-seam-bleeding-non-manifold
https://developer.blender.org/rB20db29bf2f852ffe196a3f554a373010d3e8f62d

Fix incorrect search bounds when looking for second source.

===================================================================

M	source/blender/blenkernel/intern/pbvh_pixels_copy.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
index d1fdbaaa8d0..7dc352d5ca4 100644
--- a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
+++ b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc
@@ -344,10 +344,10 @@ struct Rows {
     {
       rcti search_bounds;
       BLI_rcti_init(&search_bounds,
-                    max_ii(destination.x - 1, 0),
-                    min_ii(destination.x + 1, rows.resolution.x - 1),
-                    max_ii(destination.y - 1, 0),
-                    min_ii(destination.y + 1, rows.resolution.y - 1));
+                    max_ii(first_source.x - 1, 0),
+                    min_ii(first_source.x + 1, rows.resolution.x - 1),
+                    max_ii(first_source.y - 1, 0),
+                    min_ii(first_source.y + 1, rows.resolution.y - 1));
       /* Initialize to the first source, so when no other source could be found it will use the
        * first_source. */
       int2 found_source = first_source;
@@ -425,7 +425,7 @@ struct Rows {
               continue;
             }
             float new_distance = blender::math::distance(float2(sx, sy), float2(x, row_number));
-            if (found_distance > new_distance) {
+            if (new_distance < found_distance) {
               found_source = int2(sx, sy);
               found_distance = new_distance;
             }



More information about the Bf-blender-cvs mailing list