Skip to content

Commit

Permalink
Update curvedetail to use uint, and add global function.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregersn committed Nov 6, 2024
1 parent 79b7146 commit 7548dc8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/pyro/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions include/pyro/pyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace Pyro
return g;
}

void Graphics::curvedetail(int segments)
void Graphics::curvedetail(unsigned int segments)
{
this->_curvedetail = segments;
}
Expand Down
2 changes: 2 additions & 0 deletions src/pyro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); };
Expand Down

0 comments on commit 7548dc8

Please sign in to comment.