From 2a98bb96f12a74a81e89ef32d3890d96c33fae59 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 1 Mar 2024 13:29:24 +0800 Subject: [PATCH] fix: blur effect on non 1:1 views --- Sources/Glur/blur.metal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Glur/blur.metal b/Sources/Glur/blur.metal index aea5f3e..351b343 100644 --- a/Sources/Glur/blur.metal +++ b/Sources/Glur/blur.metal @@ -104,7 +104,7 @@ void calculateGaussianWeights(float radius, half4 result = half4(0.0); for (int i = 0; i < kernelSize; ++i) { float offset = i-(kernelSize-1)/2; - float y = clamp(position.y+offset, 0.0, layer.tex.get_width()-1.0); + float y = clamp(position.y+offset, 0.0, layer.tex.get_height()-1.0); result+= layer.sample(float2(position.x, y))*weights[i]; }