From 7548dc892e2bf9cf3bf8047d7d01a74bf4985dc7 Mon Sep 17 00:00:00 2001 From: Greger Stolt Nilsen Date: Thu, 7 Nov 2024 00:14:21 +0100 Subject: [PATCH] Update curvedetail to use uint, and add global function. --- include/pyro/graphics.h | 4 ++-- include/pyro/pyro.h | 2 ++ src/graphics.cpp | 2 +- src/pyro.cpp | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/pyro/graphics.h b/include/pyro/graphics.h index dcc9184..32a57bd 100644 --- a/include/pyro/graphics.h +++ b/include/pyro/graphics.h @@ -27,7 +27,7 @@ namespace Pyro std::filesystem::path filename{""}; bool _smooth{true}; - int _curvedetail{32}; + unsigned int _curvedetail{32}; Shape _shape{Shape()}; Transformer2D transformer; @@ -77,7 +77,7 @@ namespace Pyro Color stroke(int c, int a = 255); Color stroke(int r, int g, int b, int a = 255); - void curvedetail(int segments); + void curvedetail(unsigned int segments); float strokeweight(); float strokeweight(float w); diff --git a/include/pyro/pyro.h b/include/pyro/pyro.h index 669a485..be8d18e 100644 --- a/include/pyro/pyro.h +++ b/include/pyro/pyro.h @@ -48,6 +48,8 @@ namespace Pyro // TODO: clear // TODO: colormode + void curvedetail(int segments); + Color fill(); Color fill(Color const &c); Color fill(float c, float a = 1.0); diff --git a/src/graphics.cpp b/src/graphics.cpp index ae06495..661de36 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -60,7 +60,7 @@ namespace Pyro return g; } - void Graphics::curvedetail(int segments) + void Graphics::curvedetail(unsigned int segments) { this->_curvedetail = segments; } diff --git a/src/pyro.cpp b/src/pyro.cpp index d5194d3..6ce1a79 100644 --- a/src/pyro.cpp +++ b/src/pyro.cpp @@ -73,6 +73,8 @@ namespace Pyro pixels = nullptr; } + void curvedetail(int segments) { pg->curvedetail(segments); } + Color fill() { return pg->fill(); }; Color fill(Color const &c) { return pg->fill(c); }; Color fill(float c, float a) { return pg->fill(c, c, c, a); };