From 01dfaee33f727a73a1d8104aa4de5556d0bd48a5 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Tue, 20 Aug 2024 15:12:14 +0300 Subject: [PATCH] Tweak mixer appearance (octagon -> circle) --- source/application.cpp | 47 +++++------------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/source/application.cpp b/source/application.cpp index 7dd050f..39fa2ee 100644 --- a/source/application.cpp +++ b/source/application.cpp @@ -902,57 +902,20 @@ 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); - 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}, - }; + float s = bbox[0].length() * 0.025f; 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) - { - 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}; - } + r -= s; - 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); - } + painter.circle(box.center(), r, color, 72); } auto c = bbox.center();