More Direct2D work.
This commit is contained in:
parent
a7d8a87540
commit
d8715e6928
|
@ -225,9 +225,14 @@ void uiDrawPathCloseFigure(uiDrawPath *p)
|
|||
p->inFigure = FALSE;
|
||||
}
|
||||
|
||||
void uiDrawPathAddRectangle(uiDrawPath *p, double x0, double y0, double xxxxTODOxxxx, double xxxTODOxxxxxxxxxx)
|
||||
void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height)
|
||||
{
|
||||
// TODO
|
||||
// this is the same algorithm used by cairo and Core Graphics, according to their documentations
|
||||
uiDrawPathNewFigure(p, x, y);
|
||||
uiDrawPathLineTo(p, x + width, y);
|
||||
uiDrawPathLineTo(p, x + width, y + height);
|
||||
uiDrawPathLineTo(p, x, y + height);
|
||||
uiDrawPathCloseFigure(p);
|
||||
}
|
||||
|
||||
void uiDrawPathEnd(uiDrawPath *p)
|
||||
|
|
|
@ -58,9 +58,9 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
|
|||
brush.B = 0;
|
||||
brush.A = 0.5;
|
||||
path = uiDrawNewPath(uiDrawFillModeWinding);
|
||||
//TODO uiDrawRectangle(path, 120, 80, 50, 50);
|
||||
uiDrawPathAddRectangle(path, 120, 80, 50, 50);
|
||||
uiDrawPathEnd(path);
|
||||
// uiDrawFill(p->Context, path, &brush);
|
||||
uiDrawFill(p->Context, path, &brush);
|
||||
uiDrawFreePath(path);
|
||||
brush.A = 1;
|
||||
|
||||
|
|
|
@ -132,6 +132,7 @@ void uiDrawPathBezierTo(uiDrawPath *, double, double, double, double, double, do
|
|||
// TODO quadratic bezier
|
||||
void uiDrawPathCloseFigure(uiDrawPath *);
|
||||
|
||||
// TODO effect of these when a figure is already started
|
||||
void uiDrawPathAddRectangle(uiDrawPath *, double, double, double, double);
|
||||
|
||||
void uiDrawPathEnd(uiDrawPath *);
|
||||
|
|
Loading…
Reference in New Issue