0

I'm going to scale surfaceview with ScaleGestureDetector, not onDraw().

How to get CustomSurfaceView's left top right bottom in SimpleOnScaleGestureListener.onScale?

private SimpleOnScaleGestureListener mSimpleListener = new ScaleGestureDetector.SimpleOnScaleGestureListener() {

    @Override
    public boolean onScale(ScaleGestureDetector detector) {

        int left = (int) (detector.getPreviousSpanX());
        int top = (int) (detector.getPreviousSpanY());
        int right = (int) (detector.getCurrentSpanX()-detector.getPreviousSpanX());
        int bottom = (int) (detector.getCurrentSpanY()-detector.getPreviousSpanY());


        mCustomSurfaceView.layout(left, top, right, bottom);


        invalidate();


        return true;
    };

};
user818992
  • 97
  • 1
  • 7

0 Answers0