예제 #1
0
        // 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;
        }
예제 #2
0
 public override void DrawRect(CGRect dirtyRect)
 {
     if (BackgroundColor != null)
     {
         BackgroundColor.SetFill();
         NSBezierPath.FillRect(dirtyRect);
     }
     else
     {
         base.DrawRect(dirtyRect);
     }
     if (OnPaint != null)
     {
         OnPaint(dirtyRect.ToRectangleF());
     }
 }
예제 #3
0
 internal RectangleF GetBounds() => regionBounds.ToRectangleF();