public void StartPinchToZoom(float x0, float y0, float x1, float y1)
        {
            // update previous distance
            previousDist = LineUtil.Distance(x0, y0, x1, y1);

            if (previousDist > minPinchToZoomDistance)
            {
                savedMatrix.Set(matrix);

                LineUtil.Middle(ref middle, x0, y0, x1, y1);
            }
        }
        public void PinchToZoom(float x0, float y0, float x1, float y1)
        {
            float currentDist = LineUtil.Distance(x0, y0, x1, y1);

            if (currentDist > minPinchToZoomDistance)
            {
                float scale = currentDist / previousDist;

                matrix.Set(savedMatrix);
                matrix.PostScale(scale, scale, middle.X, middle.Y);
                matrix.GetValues(matrixValues);

                zoom = matrixValues[Matrix.MscaleX];
                translate.Set(matrixValues[Matrix.MtransX], matrixValues[Matrix.MtransY]);
            }
        }