//------------------------------------------------------------------------------
double Area(OutRec outRec, bool UseFull64BitRange)
{
OutPt op = outRec.pts;
if (op == null) return 0;
if (UseFull64BitRange)
{
Int128 a = new Int128(0);
do
{
a += Int128.Int128Mul(op.pt.X + op.prev.pt.X, op.prev.pt.Y - op.pt.Y);
op = op.next;
} while (op != outRec.pts);
return a.ToDouble() / 2;
}
else
{
double a = 0;
do {
a = a + (op.pt.X + op.prev.pt.X) * (op.prev.pt.Y - op.pt.Y);
op = op.next;
} while (op != outRec.pts);
return a/2;
}
}