diff --git a/common/src/app/common/geom/bounds_map.cljc b/common/src/app/common/geom/bounds_map.cljc index 55230c9c0b..86bf10b756 100644 --- a/common/src/app/common/geom/bounds_map.cljc +++ b/common/src/app/common/geom/bounds_map.cljc @@ -79,10 +79,10 @@ (loop [new-ids (->> (cfh/get-parent-seq objects cid) (take-while #(and (cfh/group-like-shape? %) - (not (.has ids %)))) + (not (.has ids (:id %))))) (seq))] (when (some? new-ids) - (.add ids (first new-ids)) + (.add ids (:id (first new-ids))) (recur (next new-ids)))) (recur (next base-ids))))) ids))) diff --git a/common/test/common_tests/geom_shapes_intersect_test.cljc b/common/test/common_tests/geom_shapes_intersect_test.cljc index e6c73b0474..1ae12ef2b7 100644 --- a/common/test/common_tests/geom_shapes_intersect_test.cljc +++ b/common/test/common_tests/geom_shapes_intersect_test.cljc @@ -52,12 +52,10 @@ [(pt 0 5) (pt 10 5)])))) (t/testing "Two collinear overlapping segments" - ;; NOTE: The implementation compares orientation result (namespaced keyword ::coplanar) - ;; against unnamespaced :coplanar, so the collinear branch never triggers. - ;; Collinear overlapping segments are NOT detected as intersecting. - (t/is (false? (gint/intersect-segments? - [(pt 0 0) (pt 10 0)] - [(pt 5 0) (pt 15 0)])))) + ;; Collinear overlapping segments correctly detected as intersecting. + (t/is (true? (gint/intersect-segments? + [(pt 0 0) (pt 10 0)] + [(pt 5 0) (pt 15 0)])))) (t/testing "Two non-overlapping collinear segments" (t/is (false? (gint/intersect-segments?