Ejemplo n.º 1
0
 public virtual void GetBounds(out Rect outBounds, Matrix3X3 parentMatrix)
 {
     _matrix.Set(parentMatrix);
     if (_transformAnimation != null)
     {
         _matrix = MatrixExt.PreConcat(_matrix, _transformAnimation.Matrix);
     }
     RectExt.Set(ref _rect, 0, 0, 0, 0);
     for (var i = _contents.Count - 1; i >= 0; i--)
     {
         if (_contents[i] is IDrawingContent drawingContent)
         {
             drawingContent.GetBounds(out _rect, _matrix);
             if (outBounds.IsEmpty)
             {
                 RectExt.Set(ref outBounds, _rect);
             }
             else
             {
                 RectExt.Set(ref outBounds,
                             Math.Min(outBounds.Left, _rect.Left),
                             Math.Min(outBounds.Top, _rect.Top),
                             Math.Max(outBounds.Right, _rect.Right),
                             Math.Max(outBounds.Bottom, _rect.Bottom));
             }
         }
     }
 }
Ejemplo n.º 2
0
        public void Draw(BitmapCanvas canvas, DenseMatrix parentMatrix, byte alpha)
        {
            var copies       = _copies.Value.Value;
            var offset       = _offset.Value.Value;
            var startOpacity = _transform.StartOpacity.Value.Value / 100f;
            var endOpacity   = _transform.EndOpacity.Value.Value / 100f;

            for (var i = (int)copies - 1; i >= 0; i--)
            {
                _matrix.Set(parentMatrix);
                _matrix = MatrixExt.PreConcat(_matrix, _transform.GetMatrixForRepeater(i + offset));
                float newAlpha = alpha * MiscUtils.Lerp(startOpacity, endOpacity, i / copies);
                _contentGroup.Draw(canvas, _matrix, (byte)newAlpha);
            }
        }
Ejemplo n.º 3
0
        public virtual void Draw(BitmapCanvas canvas, Matrix3X3 parentMatrix, byte parentAlpha)
        {
            _matrix.Set(parentMatrix);
            byte alpha;

            if (_transformAnimation != null)
            {
                _matrix = MatrixExt.PreConcat(_matrix, _transformAnimation.Matrix);
                alpha   = (byte)(_transformAnimation.Opacity.Value / 100f * parentAlpha / 255f * 255);
            }
            else
            {
                alpha = parentAlpha;
            }

            for (var i = _contents.Count - 1; i >= 0; i--)
            {
                var drawingContent = _contents[i] as IDrawingContent;
                drawingContent?.Draw(canvas, _matrix, alpha);
            }
        }
Ejemplo n.º 4
0
 public void Concat(DenseMatrix parentMatrix)
 {
     _matrix = MatrixExt.PreConcat(_matrix, parentMatrix);
 }
Ejemplo n.º 5
0
 public void Concat(Matrix3X3 parentMatrix)
 {
     _matrix = MatrixExt.PreConcat(_matrix, parentMatrix);
 }