From 5383daf3b4a53fb266dd5fae74810a0feb7967db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 30 Jan 2026 18:39:24 +0100 Subject: [PATCH] Math: lol wait, I used scatter() wrong in here the whole time?! Since the very first time scatter() got introduced in 2019, in acc8d8994b969e10297a9ae01acb1e71f95145be. Only the recently added CORRADE_NODISCARD annotation uncovered the bug. --- doc/snippets/Math.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/snippets/Math.cpp b/doc/snippets/Math.cpp index 37ea6790a..25334d6f5 100644 --- a/doc/snippets/Math.cpp +++ b/doc/snippets/Math.cpp @@ -186,11 +186,11 @@ static_cast(x); Vector4i orig{-1, 2, 3, 4}; Vector4i bgra = Math::gather<'b', 'g', 'r', 'a'>(orig); // {3, 2, -1, 4} Math::Vector<6, Int> w10xyz = Math::gather<'w', '1', '0', 'x', 'y', 'z'>(orig); - // {4, 1, 0, -1, 2, 3} + // {4, 1, 0, -1, 2, 3} Vector4 vec{1.5f, 3.0f, 0.1f, 1.1f}; Vector2 coords{5.0f, -2.0f}; -Math::scatter<'z', 'w'>(vec, coords); // {1.5f, 3.0f, 5.0f, -2.0f} +Math::scatterInto<'z', 'w'>(vec, coords); // {1.5f, 3.0f, 5.0f, -2.0f} /* [matrix-vector-access-swizzle] */ static_cast(bgra);