More arc testing.

This commit is contained in:
Pietro Gagliardi 2015-10-09 22:28:10 -04:00
parent 73d77ef38b
commit 50f03eca14
1 changed files with 16 additions and 1 deletions

View File

@ -81,7 +81,7 @@ static void drawOriginal(uiAreaDrawParams *p)
50, 50,
30. * (M_PI / 180.), 30. * (M_PI / 180.),
300. * (M_PI / 180.)); 300. * (M_PI / 180.));
// TODO add a checkbox for this // the sweep test below doubles as a clockwise test so a checkbox isn't needed anymore
uiDrawPathLineTo(path, 400, 100); uiDrawPathLineTo(path, 400, 100);
uiDrawPathNewFigureWithArc(path, uiDrawPathNewFigureWithArc(path,
510, 100, 510, 100,
@ -89,6 +89,20 @@ static void drawOriginal(uiAreaDrawParams *p)
30. * (M_PI / 180.), 30. * (M_PI / 180.),
300. * (M_PI / 180.)); 300. * (M_PI / 180.));
uiDrawPathCloseFigure(path); uiDrawPathCloseFigure(path);
// and now with 330 to make sure sweeps work properly
uiDrawPathNewFigure(path, 400, 210);
uiDrawPathArcTo(path,
400, 210,
50,
30. * (M_PI / 180.),
330. * (M_PI / 180.));
uiDrawPathLineTo(path, 400, 210);
uiDrawPathNewFigureWithArc(path,
510, 210,
50,
30. * (M_PI / 180.),
330. * (M_PI / 180.));
uiDrawPathCloseFigure(path);
uiDrawPathEnd(path); uiDrawPathEnd(path);
sp.Cap = uiDrawLineCapFlat; sp.Cap = uiDrawLineCapFlat;
sp.Join = uiDrawLineJoinMiter; sp.Join = uiDrawLineJoinMiter;
@ -170,6 +184,7 @@ static void drawOriginal(uiAreaDrawParams *p)
uiDrawFreePath(path); uiDrawFreePath(path);
} }
// TODO test that a sweep of 0 draws nothing
static void drawArcs(uiAreaDrawParams *p) static void drawArcs(uiAreaDrawParams *p)
{ {
uiDrawPath *path; uiDrawPath *path;