public override void DrawInteriorWithFrame(CGRect cellFrame, NSView inView)
        {
            CGContext ctx = NSGraphicsContext.CurrentContext.GraphicsPort;

            var backend = new CGContextBackend {
                Context = ctx,
                InverseViewTransform = ctx.GetCTM().Invert()
            };

            Frontend.ApplicationContext.InvokeUserCode(delegate {
                Frontend.Draw(backend, new Rectangle(cellFrame.X, cellFrame.Y, cellFrame.Width, cellFrame.Height));
            });
        }
Beispiel #2
0
        public override void DrawRect(CGRect dirtyRect)
        {
            Backend.Load(this);
            Frontend.ApplicationContext.InvokeUserCode(delegate {
                CGContext ctx = NSGraphicsContext.CurrentContext.GraphicsPort;

                var backend = new CGContextBackend {
                    Context = ctx,
                    InverseViewTransform = ctx.GetCTM().Invert()
                };
                var bounds = Backend.CellBounds;
                backend.Context.ClipToRect(dirtyRect);
                backend.Context.TranslateCTM((nfloat)(-bounds.X), (nfloat)(-bounds.Y));
                Frontend.Draw(backend, new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height));
            });
        }