Beispiel #1
0
        public CGPath GetClipPath()
        {
            if (_pathProvider == null)
            {
                return(new CGPath());
            }

            if (_pathDirty || _pathProvider.IsPathDirty)
            {
                _pathDirty = false;
                _pathProvider.CreatePath(Bounds);
            }

            return(new CGPath(_pathProvider.Path));
        }
Beispiel #2
0
        private void InitializeClippingPath()
        {
            if (_pathProvider == null)
            {
                return;
            }

            var clipPath = _pathProvider.CreatePath(_width, _height);

            if (clipPath == null)
            {
                return;
            }

            _clipPath.Reset();
            _clipPath.Set(clipPath);

            if (CanDrawBorder())
            {
                _maskPath.Reset();
                _maskPath.AddRect(0, 0, _width, _height, Path.Direction.Cw);
                _maskPath.InvokeOp(_clipPath, Path.Op.Difference);
            }
        }