Non existent errors in windows draw path are inconsistent with OSX/GTK
This commit is contained in:
parent
211b11b80f
commit
247c21e91d
|
@ -50,6 +50,9 @@ void uiDrawPathNewFigure(uiDrawPath *p, double x, double y)
|
||||||
{
|
{
|
||||||
D2D1_POINT_2F pt;
|
D2D1_POINT_2F pt;
|
||||||
|
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
if (p->inFigure)
|
if (p->inFigure)
|
||||||
p->sink->EndFigure(D2D1_FIGURE_END_OPEN);
|
p->sink->EndFigure(D2D1_FIGURE_END_OPEN);
|
||||||
pt.x = x;
|
pt.x = x;
|
||||||
|
@ -161,6 +164,9 @@ void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, d
|
||||||
{
|
{
|
||||||
struct arc a;
|
struct arc a;
|
||||||
|
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
a.xCenter = xCenter;
|
a.xCenter = xCenter;
|
||||||
a.yCenter = yCenter;
|
a.yCenter = yCenter;
|
||||||
a.radius = radius;
|
a.radius = radius;
|
||||||
|
@ -174,6 +180,9 @@ void uiDrawPathLineTo(uiDrawPath *p, double x, double y)
|
||||||
{
|
{
|
||||||
D2D1_POINT_2F pt;
|
D2D1_POINT_2F pt;
|
||||||
|
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
pt.x = x;
|
pt.x = x;
|
||||||
pt.y = y;
|
pt.y = y;
|
||||||
p->sink->AddLine(pt);
|
p->sink->AddLine(pt);
|
||||||
|
@ -183,6 +192,9 @@ void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radiu
|
||||||
{
|
{
|
||||||
struct arc a;
|
struct arc a;
|
||||||
|
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
a.xCenter = xCenter;
|
a.xCenter = xCenter;
|
||||||
a.yCenter = yCenter;
|
a.yCenter = yCenter;
|
||||||
a.radius = radius;
|
a.radius = radius;
|
||||||
|
@ -196,6 +208,9 @@ void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, doubl
|
||||||
{
|
{
|
||||||
D2D1_BEZIER_SEGMENT s;
|
D2D1_BEZIER_SEGMENT s;
|
||||||
|
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
s.point1.x = c1x;
|
s.point1.x = c1x;
|
||||||
s.point1.y = c1y;
|
s.point1.y = c1y;
|
||||||
s.point2.x = c2x;
|
s.point2.x = c2x;
|
||||||
|
@ -207,12 +222,18 @@ void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, doubl
|
||||||
|
|
||||||
void uiDrawPathCloseFigure(uiDrawPath *p)
|
void uiDrawPathCloseFigure(uiDrawPath *p)
|
||||||
{
|
{
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
p->sink->EndFigure(D2D1_FIGURE_END_CLOSED);
|
p->sink->EndFigure(D2D1_FIGURE_END_CLOSED);
|
||||||
p->inFigure = FALSE;
|
p->inFigure = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height)
|
void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height)
|
||||||
{
|
{
|
||||||
|
if (p->sink == NULL)
|
||||||
|
userbug("You cannot modify a uiDrawPath that has been ended. (path: %p)", p);
|
||||||
|
|
||||||
// this is the same algorithm used by cairo and Core Graphics, according to their documentations
|
// this is the same algorithm used by cairo and Core Graphics, according to their documentations
|
||||||
uiDrawPathNewFigure(p, x, y);
|
uiDrawPathNewFigure(p, x, y);
|
||||||
uiDrawPathLineTo(p, x + width, y);
|
uiDrawPathLineTo(p, x + width, y);
|
||||||
|
|
Loading…
Reference in New Issue