MCPcopy Create free account
hub / github.com/PricelessToolkit/MailBoxGuard / fillCircle

Method fillCircle

Code/Arduino_libraries/SSD1306/OLEDDisplay.cpp:287–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286
287void OLEDDisplay::fillCircle(int16_t x0, int16_t y0, int16_t radius) {
288 int16_t x = 0, y = radius;
289 int16_t dp = 1 - radius;
290 do {
291 if (dp < 0)
292 dp = dp + (x++) * 2 + 3;
293 else
294 dp = dp + (x++) * 2 - (y--) * 2 + 5;
295
296 drawHorizontalLine(x0 - x, y0 - y, 2*x);
297 drawHorizontalLine(x0 - x, y0 + y, 2*x);
298 drawHorizontalLine(x0 - y, y0 - x, 2*y);
299 drawHorizontalLine(x0 - y, y0 + x, 2*y);
300
301
302 } while (x < y);
303 drawHorizontalLine(x0 - radius, y0, 2 * radius);
304
305}
306
307void OLEDDisplay::drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
308 int16_t x2, int16_t y2) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected