circle-outline

xod/graphics/circle-outline

Represents a circle drawn with the foreground color.
circle-outline
@/circle-outline
Represents a circle drawn with the foreground color.
Xnumber
X coordinate of the center point of the circle on the canvas.
GFX@/graphics
Ynumber
Y coordinate of the center point of the circle on the canvas.
Rnumber
Radius of the circle.
circle-outline
X
GFX
Y
R
GFX'
GFX'@/graphics

C++ implementation

#include <Circle.h>

node {
    uint8_t mem[sizeof(CircleOutline)];
    CircleOutline* circleOutline;
    int16_t x, y, r;

    void evaluate(Context ctx) {
        auto gfx = getValue<input_GFX>(ctx);

        int16_t x = (int16_t)getValue<input_X>(ctx);
        int16_t y = (int16_t)getValue<input_Y>(ctx);
        int16_t r = (int16_t)getValue<input_R>(ctx);

        if (isSettingUp()) {
            circleOutline = new (mem) CircleOutline(gfx);
        }

        if (isSettingUp() || x != x || y != y || r != r) {
            x = x;
            y = y;
            r = r;
            circleOutline->setPosition(x, y, r);
            emitValue<output_GFXU0027>(ctx, circleOutline);
        }

        if (isInputDirty<input_GFX>(ctx)) {
            emitValue<output_GFXU0027>(ctx, circleOutline);
        }
    }
}