Esempio n. 1
0
        public override AdjustSizeResult AdjustSizeByDelta(Figure figure, float dTop, float dRight, float dBottom, float dLeft,
                                                           AdjustSizeResult adjustSizeResult)
        {
            var bb = figure.GetBoundingBoxIncludeLinked();

            bb.AdjustDimensions(dTop, dRight, dBottom, dLeft);


            if (Region.Contains(bb))
            {
                return(adjustSizeResult);
            }

            if (bb.Top > Region.Top)
            {
                adjustSizeResult.DeltaTop = 0;
                adjustSizeResult.LockDeltaTop();
            }

            if (bb.Right > Region.Right)
            {
                adjustSizeResult.DeltaRight = 0;
                adjustSizeResult.LockDeltaRight();
            }

            if (bb.Bottom < Region.Bottom)
            {
                adjustSizeResult.DeltaBottom = 0;
                adjustSizeResult.LockDeltaBottom();
            }

            if (bb.Left < Region.Left)
            {
                adjustSizeResult.DeltaLeft = 0;
                adjustSizeResult.LockDeltaLeft();
            }

            return(adjustSizeResult);
        }
 public virtual AdjustSizeResult AdjustSizeByDelta(Figure figure, float dTop, float dRight, float dBottom, float dLeft,
                                                   AdjustSizeResult adjustSizeResult)
 {
     return(adjustSizeResult);
 }