internal void Setup(Graphics graphics, bool fill)
{
CGContext context = graphics.context;
brush.Setup (graphics, fill);
// TODO: apply matrix
if (graphics.LastPen == this && !changed)
return;
// A Width of 0 will result in the Pen drawing as if the Width were 1.
width = width == 0 ? 1 : width;
//width = graphics.GraphicsUnitConvertFloat (width);
context.SetLineWidth (width);
switch (startCap)
{
case LineCap.Flat:
context.SetLineCap(CGLineCap.Butt);
break;
case LineCap.Square:
context.SetLineCap(CGLineCap.Square);
break;
case LineCap.Round:
context.SetLineCap(CGLineCap.Round);
break;
// case LineCap.Triangle:
// case LineCap.NoAnchor:
// case LineCap.SquareAnchor:
// case LineCap.RoundAnchor:
// case LineCap.DiamondAnchor:
// case LineCap.ArrowAnchor:
// case LineCap.AnchorMask:
// case LineCap.Custom:
default:
context.SetLineCap(CGLineCap.Butt);
break;
}
switch (dashStyle)
{
case DashStyle.Dash:
context.SetLineDash(dashOffset,setupMorseCode(Dash));
break;
case DashStyle.Dot:
context.SetLineDash(dashOffset,setupMorseCode(Dot));
break;
case DashStyle.DashDot:
context.SetLineDash(dashOffset,setupMorseCode(DashDot));
break;
case DashStyle.DashDotDot:
context.SetLineDash(dashOffset,setupMorseCode(DashDotDot));
break;
default:
context.SetLineDash(0, new nfloat[0]);
break;
}
// miter limit
// join
// cap
// dashes
changed = false;
graphics.LastPen = this;
}