コード例 #1
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
        public static IExplicitShape <GridPoint2> Translate(this IExplicitShape <GridPoint2> shape, GridPoint2 n)
        {
            var newBounds = GridRect.Translate(shape.Bounds, n);
            var newShape  = ImplicitShape.Translate(shape, n).ToExplicit(newBounds);

            return(newShape);
        }
コード例 #2
0
ファイル: ExplicitShape.cs プロジェクト: Radeg/dots_all-modes
            public ExplicitShape2 Translate(GridPoint2 offset)
            {
                var map = Map.Translate(offset);

                var newRect  = GridRect.Translate(storageBounds, offset);
                var newShape = ImplicitShape.Transform(implicitShape, map);

                return(new ExplicitShape2(newShape, newRect));
            }