Renamed uiDrawArc to uiDrawArcTo.

This commit is contained in:
Pietro Gagliardi 2015-09-08 16:28:08 -04:00
parent 61fee661c2
commit 4d97644f94
6 changed files with 8 additions and 10 deletions

View File

@ -49,7 +49,7 @@ void uiDrawRectangle(uiDrawContext *c, intmax_t x, intmax_t y, intmax_t width, i
cairo_rectangle(c->cr, ((double) x) + 0.5, ((double) y) + 0.5, width, height); cairo_rectangle(c->cr, ((double) x) + 0.5, ((double) y) + 0.5, width, height);
} }
void uiDrawArc(uiDrawContext *c, intmax_t xCenter, intmax_t yCenter, intmax_t radius, double startAngle, double endAngle, int lineFromCurrentPointToStart) void uiDrawArcTo(uiDrawContext *c, intmax_t xCenter, intmax_t yCenter, intmax_t radius, double startAngle, double endAngle, int lineFromCurrentPointToStart)
{ {
if (!lineFromCurrentPointToStart) if (!lineFromCurrentPointToStart)
cairo_new_sub_path(c->cr); cairo_new_sub_path(c->cr);

View File

@ -53,7 +53,7 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
uiDrawBeginPathRGB(p->Context, 0x80, 0xC0, 0x00); uiDrawBeginPathRGB(p->Context, 0x80, 0xC0, 0x00);
uiDrawMoveTo(p->Context, 400, 100); uiDrawMoveTo(p->Context, 400, 100);
uiDrawArc(p->Context, uiDrawArcTo(p->Context,
400, 100, 400, 100,
50, 50,
30. * (M_PI / 180.), 30. * (M_PI / 180.),
@ -63,7 +63,7 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
1); 1);
// TODO add a checkbox for this // TODO add a checkbox for this
uiDrawLineTo(p->Context, 400, 100); uiDrawLineTo(p->Context, 400, 100);
uiDrawArc(p->Context, uiDrawArcTo(p->Context,
510, 100, 510, 100,
50, 50,
30. * (M_PI / 180.), 30. * (M_PI / 180.),

View File

@ -67,7 +67,6 @@ struct uiDrawStrokeParams {
uiDrawLineCap Cap; uiDrawLineCap Cap;
uiDrawLineJoin Join; uiDrawLineJoin Join;
intmax_t Thickness; intmax_t Thickness;
// TODO float for GDI?
double MiterLimit; double MiterLimit;
}; };
@ -78,7 +77,7 @@ void uiDrawMoveTo(uiDrawContext *, intmax_t, intmax_t);
void uiDrawLineTo(uiDrawContext *, intmax_t, intmax_t); void uiDrawLineTo(uiDrawContext *, intmax_t, intmax_t);
void uiDrawRectangle(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t); void uiDrawRectangle(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t);
// notes: angles are both relative to 0 and go counterclockwise // notes: angles are both relative to 0 and go counterclockwise
void uiDrawArc(uiDrawContext *, intmax_t, intmax_t, intmax_t, double, double, int); void uiDrawArcTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, double, double, int);
// TODO behavior when there is no initial point on Windows and OS X // TODO behavior when there is no initial point on Windows and OS X
void uiDrawBezierTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t); void uiDrawBezierTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t);
void uiDrawCloseFigure(uiDrawContext *); void uiDrawCloseFigure(uiDrawContext *);

View File

@ -64,7 +64,7 @@ void uiDrawRectangle(uiDrawContext *c, intmax_t x, intmax_t y, intmax_t width, i
logLastError("error drawing rectangle in uiDrawRectangle()"); logLastError("error drawing rectangle in uiDrawRectangle()");
} }
void uiDrawArc(uiDrawContext *c, intmax_t xCenter, intmax_t yCenter, intmax_t radius, double startAngle, double endAngle, int lineFromCurrentPointToStart) void uiDrawArcTo(uiDrawContext *c, intmax_t xCenter, intmax_t yCenter, intmax_t radius, double startAngle, double endAngle, int lineFromCurrentPointToStart)
{ {
if (!lineFromCurrentPointToStart) { if (!lineFromCurrentPointToStart) {
int bx, by, bx2, by2; int bx, by, bx2, by2;

View File

@ -51,7 +51,7 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
uiDrawBeginPathRGB(p->Context, 0x80, 0xC0, 0x00); uiDrawBeginPathRGB(p->Context, 0x80, 0xC0, 0x00);
uiDrawMoveTo(p->Context, 400, 100); uiDrawMoveTo(p->Context, 400, 100);
uiDrawArc(p->Context, uiDrawArcTo(p->Context,
400, 100, 400, 100,
50, 50,
30. * (M_PI / 180.), 30. * (M_PI / 180.),
@ -61,7 +61,7 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
1); 1);
// TODO add a checkbox for this // TODO add a checkbox for this
uiDrawLineTo(p->Context, 400, 100); uiDrawLineTo(p->Context, 400, 100);
uiDrawArc(p->Context, uiDrawArcTo(p->Context,
510, 100, 510, 100,
50, 50,
30. * (M_PI / 180.), 30. * (M_PI / 180.),

View File

@ -67,7 +67,6 @@ struct uiDrawStrokeParams {
uiDrawLineCap Cap; uiDrawLineCap Cap;
uiDrawLineJoin Join; uiDrawLineJoin Join;
intmax_t Thickness; intmax_t Thickness;
// TODO float for GDI?
double MiterLimit; double MiterLimit;
}; };
@ -78,7 +77,7 @@ void uiDrawMoveTo(uiDrawContext *, intmax_t, intmax_t);
void uiDrawLineTo(uiDrawContext *, intmax_t, intmax_t); void uiDrawLineTo(uiDrawContext *, intmax_t, intmax_t);
void uiDrawRectangle(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t); void uiDrawRectangle(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t);
// notes: angles are both relative to 0 and go counterclockwise // notes: angles are both relative to 0 and go counterclockwise
void uiDrawArc(uiDrawContext *, intmax_t, intmax_t, intmax_t, double, double, int); void uiDrawArcTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, double, double, int);
// TODO behavior when there is no initial point on Windows and OS X // TODO behavior when there is no initial point on Windows and OS X
void uiDrawBezierTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t); void uiDrawBezierTo(uiDrawContext *, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t, intmax_t);
void uiDrawCloseFigure(uiDrawContext *); void uiDrawCloseFigure(uiDrawContext *);