Пример #1
0
 public SkiaEditorContainerPresenter(IToolContext context, IContainerView view)
 {
     _context      = context;
     _view         = view;
     _skiaRenderer = new SkiaShapeRenderer(_context, _view.SelectionState);
     _paintCache   = new Dictionary <ArgbColor, SKPaint>();
 }
Пример #2
0
 public SkiaEditorContainerPresenter(IToolContext context, IContainerView view)
 {
     _context      = context;
     _view         = view;
     _skiaRenderer = new SkiaShapeRenderer(_context, _view, _view.SelectionState);
     _paintCache   = new Dictionary <IPaint, SKPaint>();
     _disposable   = new CompositeDisposable();
 }
Пример #3
0
 public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy)
 {
     using (var renderer = new SkiaShapeRenderer(_context, _view.SelectionState))
         using (var background = SkiaHelper.ToSKPaintBrush(_view.PrintBackground, false))
         {
             var canvas = context as SKCanvas;
             canvas.DrawRect(SkiaHelper.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background);
             _view.CurrentContainer.Draw(canvas, renderer, dx, dy, zx, null, null);
         }
 }
        public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy, double renderScaling)
        {
            using var renderer   = new SkiaShapeRenderer(_context, _view, _view.SelectionState);
            using var disposable = new CompositeDisposable();
            using var background = SkiaUtil.ToSKPaint(_view.PrintBackground, null, zx, disposable.Disposables);
            var canvas = context as SKCanvas;

            canvas.DrawRect(SkiaUtil.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background);
            _view.CurrentContainer.Draw(canvas, renderer, dx, dy, zx, null, null);
        }
        public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy)
        {
            using (var renderer = new SkiaShapeRenderer(_context, _view.SelectionState))
                using (var background = SkiaHelper.ToSKPaintBrush(_view.PrintBackground, false))
                {
                    var canvas = context as SKCanvas;
                    canvas.DrawRect(SkiaHelper.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background);

                    var selected = new List <IBaseShape>(_view.SelectionState?.Shapes);
                    foreach (var shape in selected)
                    {
                        if (IsAcceptedShape(shape))
                        {
                            shape.Draw(canvas, renderer, dx, dy, zx, null, null);
                        }
                    }
                }
        }
        public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy, double renderScaling)
        {
            using var renderer   = new SkiaShapeRenderer(_context, _view, _view.SelectionState);
            using var disposable = new CompositeDisposable();
            using var background = SkiaUtil.ToSKPaint(_view.PrintBackground, null, zx, disposable.Disposables);
            var canvas = context as SKCanvas;

            canvas.DrawRect(SkiaUtil.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background);

            var selected = new List <IBaseShape>(_view.SelectionState?.Shapes);

            foreach (var shape in selected)
            {
                if (IsAcceptedShape(shape))
                {
                    shape.Draw(canvas, renderer, dx, dy, zx, null, null);
                }
            }
        }