ajstarks/openvg

Inconsistency on Circle/CircleOutline third parameter

Closed this issue · 1 comments

5o50 commented

The documentation says :

void Circle(VGfloat x, VGfloat y, VGfloat r)
Draw a circle centered at (x,y) with radius r.

Circle() is just a wrapper around Ellipse() that directly pass r parameter, thus the advertised r (radius) for Circle() must not be used as a radius but as a diameter at the current state of the codebase.
see :

openvg/libshapes.c

Lines 608 to 619 in 2b32039

// Ellipse makes an ellipse at the specified location and dimensions
void Ellipse(VGfloat x, VGfloat y, VGfloat w, VGfloat h) {
VGPath path = newpath();
vguEllipse(path, x, y, w, h);
vgDrawPath(path, VG_FILL_PATH | VG_STROKE_PATH);
vgDestroyPath(path);
}
// Circle makes a circle at the specified location and dimensions
void Circle(VGfloat x, VGfloat y, VGfloat r) {
Ellipse(x, y, r, r);
}

Please adapt the documentation to reflect this behaviour or adapt the code.

Thank you

fixed.