Made arc angles counterclockwise on the GTK+ backend and fixed the sun in the Direct2D geometries howto.
This commit is contained in:
parent
50f03eca14
commit
3cbc3f3c67
|
@ -554,7 +554,7 @@ static void drawD2DPathGeometries(uiAreaDrawParams *p)
|
||||||
|
|
||||||
sun = uiDrawNewPath(uiDrawFillModeWinding);
|
sun = uiDrawNewPath(uiDrawFillModeWinding);
|
||||||
uiDrawPathNewFigureWithArc(sun,
|
uiDrawPathNewFigureWithArc(sun,
|
||||||
440.0, 255,
|
(440.0 - 270.0) / 2 + 270.0, 255,
|
||||||
85,
|
85,
|
||||||
0, M_PI);
|
0, M_PI);
|
||||||
uiDrawPathCloseFigure(sun);
|
uiDrawPathCloseFigure(sun);
|
||||||
|
|
10
unix/draw.c
10
unix/draw.c
|
@ -152,14 +152,14 @@ static void runPath(uiDrawPath *p, cairo_t *cr)
|
||||||
cairo_new_sub_path(cr);
|
cairo_new_sub_path(cr);
|
||||||
// fall through
|
// fall through
|
||||||
case arcTo:
|
case arcTo:
|
||||||
// the Windows AngleArc() function only goes counterclockwise, so our uiDrawArc() function does too
|
// cairo_arc() and cairo_arc_negative() only go clockwise
|
||||||
// simulate it in cairo by drawing a negative arc from end to start
|
// TODO explain why this works
|
||||||
cairo_arc_negative(cr,
|
cairo_arc(cr,
|
||||||
piece->d[0],
|
piece->d[0],
|
||||||
piece->d[1],
|
piece->d[1],
|
||||||
piece->d[2],
|
piece->d[2],
|
||||||
piece->d[3] + piece->d[4],
|
-(piece->d[3] + piece->d[4]),
|
||||||
piece->d[3]);
|
-(piece->d[3]));
|
||||||
break;
|
break;
|
||||||
case lineTo:
|
case lineTo:
|
||||||
cairo_line_to(cr, piece->d[0], piece->d[1]);
|
cairo_line_to(cr, piece->d[0], piece->d[1]);
|
||||||
|
|
Loading…
Reference in New Issue