From e1bd2b73599cad98d9db85fc7e8686d371acc8a0 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 20 Aug 2024 15:23:52 +0300 Subject: [PATCH] Revert "Tweak mixer appearance (octagon -> circle)" This reverts commit 01dfaee33f727a73a1d8104aa4de5556d0bd48a5. --- source/application.cpp | 47 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/source/application.cpp b/source/application.cpp index cee17c0..4611bc9 100644 --- a/source/application.cpp +++ b/source/application.cpp @@ -903,20 +903,57 @@ namespace gmtk float r1 = std::sqrt(2.f) * (2.f + 2.f * an) / 16.f * box[0].length(); float r2 = std::sqrt(2.f) * (4.f + 2.f * an) / 16.f * box[0].length(); + float s = bbox[0].length() * 0.025f; + float t = 0.6f * s; + box = geom::expand(box, an * box[0].length() * 0.125f); - float s = bbox[0].length() * 0.025f; + geom::point points[] + { + box.corner(0.f, 0.75f), + box.corner(0.f, 0.25f), + box.corner(0.25f, 0.f), + box.corner(0.75f, 0.f), + box.corner(1.f, 0.25f), + box.corner(1.f, 0.75f), + box.corner(0.75f, 1.f), + box.corner(0.25f, 1.f), + }; + + static geom::triangle const triangles[] + { + {0, 1, 2}, + {0, 2, 3}, + {0, 3, 4}, + {0, 4, 5}, + {0, 5, 6}, + {0, 6, 7}, + }; for (int i = 0; i < 2; ++i) { auto color = (i == 0) ? gfx::black : gfx::white; - float r = box[0].length() / 2.f; - if (i == 1) - r -= s; + { + points[0] += geom::vector{ s, -t}; + points[1] += geom::vector{ s, t}; + points[2] += geom::vector{ t, s}; + points[3] += geom::vector{-t, s}; + points[4] += geom::vector{-s, t}; + points[5] += geom::vector{-s, -t}; + points[6] += geom::vector{-t, -s}; + points[7] += geom::vector{ t, -s}; + } - painter.circle(box.center(), r, color, 72); + for (auto const & t : triangles) + { + auto p0 = points[t[0]]; + auto p1 = points[t[1]]; + auto p2 = points[t[2]]; + + painter.triangle(p0, p1, p2, color); + } } auto c = bbox.center();