From 370069e383c27c784341f506ca2b175f30a8b6b3 Mon Sep 17 00:00:00 2001
From: Stephan Hilb <stephan@ecshi.net>
Date: Sun, 5 Sep 2021 18:36:50 +0200
Subject: [PATCH] fix image sampling

---
 src/function.jl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/function.jl b/src/function.jl
index ac960fb..c871e33 100644
--- a/src/function.jl
+++ b/src/function.jl
@@ -347,7 +347,7 @@ function _sample(f::FeFunction)
 	I1 = round.(Int, SVector(maximum(A[1, :]), maximum(A[2, :])) .- m0) .+ 1
 
 	for I in CartesianIndex(I0[1], I0[2]):CartesianIndex(I1[1], I1[2])
-            x = SVector(Tuple(I) .- m0)
+            x = SVector(Tuple(I) .- 1 .+ m0)
             # TODO: move to global-to-local function or inside-triangle test
             xloc = (A[:, SUnitRange(2, 3)] .- A[:, 1])::SArray \
                 (x .- A[:, 1])
-- 
GitLab