// An infinite region would cover the entire device region which is the same as // not having a clipping region. Note that this is not the same as having an // empty region, which when clipping to it has the effect of excluding the entire // device region. public Region() { // We set the default region to a very large regionObject = infinite; var path = RectangleToPath(infinite.ToRectangleF()); solution.Add(path); regionList.Add(new RegionEntry(RegionType.Infinity, infinite, path)); regionPath = new CGPath(); regionPath.MoveToPoint(infinite.Left, infinite.Top); regionPath.AddLineToPoint(infinite.Right, infinite.Top); regionPath.AddLineToPoint(infinite.Right, infinite.Bottom); regionPath.AddLineToPoint(infinite.Left, infinite.Bottom); regionBounds = infinite; }
public override void DrawRect(CGRect dirtyRect) { if (BackgroundColor != null) { BackgroundColor.SetFill(); NSBezierPath.FillRect(dirtyRect); } else { base.DrawRect(dirtyRect); } if (OnPaint != null) { OnPaint(dirtyRect.ToRectangleF()); } }
internal RectangleF GetBounds() => regionBounds.ToRectangleF();