From 0f965f494232c7ef3e5e340bb5c74e1d38609ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 4 Jan 2025 09:25:54 +0100 Subject: [PATCH] fix: image offset by 1px in "nearest" filtering mode --- src/ImageCanvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageCanvas.cpp b/src/ImageCanvas.cpp index 87d0a04..a136f8a 100644 --- a/src/ImageCanvas.cpp +++ b/src/ImageCanvas.cpp @@ -1002,7 +1002,7 @@ Vector2f ImageCanvas::pixelOffset(const Vector2i& size) const { // size.x() % 2 == 0 ? 0.5f : 0.0f, // size.y() % 2 == 0 ? -0.5f : 0.0f, // } + Vector2f{0.1111111f}; - return Vector2f{0.1111111f}; + return Vector2f{-0.1111111f}; } Matrix3f ImageCanvas::transform(const Image* image) {