performance - Unexpected scaling behavior on a canvas in android -


I have a scene in which I am rectangular and within it there are 10 lines. I pinch the view to zoom the pin But I am getting unexpected behavior lines are scaling but not rectangular.

Can someone identify my mistake?

The on-drawing method of this view is:

  The method of screen () is method: write R = new text (0, 0, 700, 40) ; Public waste on draw (canvas canvas) {float kk = mscaleFactor; // This variable will be determined by pinch zoom event and how much the SF * = KK scale represents; // This view should be scaled according to the previous scaling canvas. MakeLinesinRangetwo (10, canvas); // This rectangular float will make the L line within the width of cX = canvas.getWidth () / 2.0f; // width 2 horizontal center float cY = canvas.getHeight () / 2.0f; // height / 2 vertical center canvas scale (SF, 1, CX, CY); Paint.setStyle (Paint.Style.FILL); Paint.setColor (Color.BLUE); Canvas Davelect (R, Paint); Canvas.restore (); RequestLayout (); // This will change the width of the view to fit the expanded rectangle}  

Also when I scale around (0,0) I am scaling both rectangular and lines. The behavior is not found.

  Public Waste On Draw (Canvas Canvas) {float kk = mscaleFactor; // This variable will be determined by pinch zoom event and how much the SF * = KK scale represents; // This view should be scaled according to the previous scaling canvas. MakeLinesinRangetwo (10, canvas); // It will make the L line within the width of the rectangular canvas scale (SF, 1); Paint.setStyle (Paint.Style.FILL); Paint.setColor (Color.BLUE); Canvas Davelect (R, Paint); Canvas.restore (); RequestLayout (); // This will change the width of the view to fit the expanded rectangle}  

It seems that the problem is that you can scale the canvas at the center, but instead you should give the pivotics and the pivot center a rectangle.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -