Exemple #1
0
        public override void Draw(CGRect rect)
        {
            if (!LiteHtmlContainer.Document.HasRendered)
            {
                return;
            }

            using (CGContext gfxc = UIGraphics.GetCurrentContext())
            {
                gfxc.SaveState();
                gfxc.TranslateCTM(Viewport.X, Viewport.Y);

                CheckViewportChange();

                LiteHtmlContainer.Context = gfxc;
                LiteHtmlContainer.Draw();
                LiteHtmlContainer.Context = null;

                gfxc.RestoreState();

                if (Drawn != null)
                {
                    Drawn();
                }
            }
        }
Exemple #2
0
        public override void DrawRect(CGRect dirtyRect)
        {
            if (!LiteHtmlContainer.Document.HasRendered)
            {
                return;
            }

            var gfxc = NSGraphicsContext.CurrentContext.GraphicsPort;

            gfxc.SaveState();
            var point = ViewportPoint;

            gfxc.TranslateCTM(point.X, point.Y);

            LiteHtmlContainer.CheckViewportChange();

            LiteHtmlContainer.Context = gfxc;
            LiteHtmlContainer.Draw();
            LiteHtmlContainer.Context = null;

            gfxc.RestoreState();

            if (Drawn != null)
            {
                Drawn();
            }
        }