Skip to content

Commit 9b2b171

Browse files
committed
improve AndresAlgorithm
1 parent d3628a2 commit 9b2b171

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/Geometry.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ namespace gf {
157157
return std::nullopt;
158158
}
159159

160+
const gf::Vec2I point = { m_x, m_y };
161+
160162
if (m_d >= 2 * m_x) {
161163
m_d = m_d - 2 * m_x - 1;
162164
++m_x;
@@ -169,7 +171,7 @@ namespace gf {
169171
--m_y;
170172
}
171173

172-
return gf::vec(m_x, m_y);
174+
return point;
173175
}
174176

175177
std::vector<Vec2I> generate_circle(Vec2I center, int32_t radius)
@@ -189,8 +191,6 @@ namespace gf {
189191
circle.emplace_back(center.x - point.y, center.y - point.x);
190192
};
191193

192-
plot_8_pixels({ 0, radius });
193-
194194
for (;;) {
195195
if (auto maybe_next = andres.step(); maybe_next) {
196196
plot_8_pixels(*maybe_next);

0 commit comments

Comments
 (0)