From c71a7bdfbd89ec915f782edeed3c894abae860ba Mon Sep 17 00:00:00 2001
From: Stephan Hilb <stephan@ecshi.net>
Date: Sat, 5 Feb 2022 19:39:10 +0100
Subject: [PATCH] add support for true scalar functions

---
 src/image.jl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/image.jl b/src/image.jl
index 8a84e93..e3629c4 100644
--- a/src/image.jl
+++ b/src/image.jl
@@ -120,7 +120,8 @@ function _sample(f::FeFunction)
                 (x .- A[:, 1])
             ε = eps()
             if all(xloc .>= -ε) && sum(xloc) <= 1 + ε
-                out[fcolon..., I] .= evaluate(f, xloc)
+                # use view here to handle scalar data assigment as well
+                view(out, fcolon..., I) .= evaluate(f, xloc)
             end
         end
     end
-- 
GitLab