예제 #1
0
        private void DrawFrameExtended(Context contextParent, Sequence.FrameEx frameEx)
        {
            var context = contextParent.Clone();

            context.Left   = frameEx.Left * context.ScaleX;
            context.Top    = frameEx.Top * context.ScaleY;
            context.Right  = frameEx.Right * context.ScaleX;
            context.Bottom = frameEx.Bottom * context.ScaleY;

            DrawFrame(context, sequence.Frames[frameEx.FrameIndex]);
        }
예제 #2
0
        public void GetVisibilityRectangleForFrameExTest()
        {
            const int ExpectedX      = 50;
            const int ExpectedY      = 70;
            const int ExpectedWidth  = 100;
            const int ExpectedHeight = 200;

            var rect = new Sequence.FrameEx
            {
                Left   = ExpectedX,
                Top    = ExpectedY,
                Right  = ExpectedX + ExpectedWidth,
                Bottom = ExpectedY + ExpectedHeight
            }.GetVisibilityRectangle();

            Assert.Equal(ExpectedX, rect.X);
            Assert.Equal(ExpectedY, rect.Y);
            Assert.Equal(ExpectedWidth, rect.Width);
            Assert.Equal(ExpectedHeight, rect.Height);
        }
예제 #3
0
 public static Rectangle GetVisibilityRectangle(
     this Sequence.FrameEx frameEx) => Rectangle.FromLTRB(
     frameEx.Left,
     frameEx.Top,
     frameEx.Right,
     frameEx.Bottom);