From ed41bc6583264ee0370a2c07e4fd2e62d9123eb6 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 13 Jun 2021 12:30:18 +0300 Subject: [PATCH] Explicit circle quality parameter for gfx::painter::circle --- libs/gfx/include/psemek/gfx/painter.hpp | 2 +- libs/gfx/source/painter.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/gfx/include/psemek/gfx/painter.hpp b/libs/gfx/include/psemek/gfx/painter.hpp index de697234..e8d352eb 100644 --- a/libs/gfx/include/psemek/gfx/painter.hpp +++ b/libs/gfx/include/psemek/gfx/painter.hpp @@ -54,7 +54,7 @@ namespace psemek::gfx // 2D void triangle(geom::point const & p0, geom::point const & p1, geom::point const & p2, color const & c); void rect(geom::box const & box, color const & c); - void circle(geom::point const & center, float radius, color const & c); + void circle(geom::point const & center, float radius, color const & c, int quality = 24); void line(geom::point const & p0, geom::point const & p1, float width, color const & c, bool smooth = true); // 2D text diff --git a/libs/gfx/source/painter.cpp b/libs/gfx/source/painter.cpp index 08cc33a7..3229ad7f 100644 --- a/libs/gfx/source/painter.cpp +++ b/libs/gfx/source/painter.cpp @@ -213,12 +213,10 @@ namespace psemek::gfx impl().indices.push_back(base + 2); } - void painter::circle(geom::point const & p, float r, color const & c) + void painter::circle(geom::point const & p, float r, color const & c, int quality) { std::uint32_t const base = impl().vertices.size(); - int const quality = 24; - impl().vertices.push_back({{p[0], p[1], 0.f}, c}); for (int i = 0; i < quality; ++i) {