コード例 #1
0
ファイル: ButtonWidget.cs プロジェクト: MichealWen/sharpmapv2
        public void AlignX(T x, Alignment alignment)
        {
            IAffineTransformMatrix <T> transform = GetTransform();

            switch (alignment)
            {
            case Alignment.Center:
                SetTransform(MatrixFactory <T> .NewTranslation(x.Subtract(Width.Divide(2)), transform.TranslationY()));
                break;

            case Alignment.Left:
                SetTransform(MatrixFactory <T> .NewTranslation(x, transform.TranslationY()));
                break;

            case Alignment.Right:
                SetTransform(MatrixFactory <T> .NewTranslation(x.Subtract(Width), transform.TranslationY()));
                break;
            }
        }