nnttoo / android-multitouch-controller

Automatically exported from code.google.com/p/android-multitouch-controller
0 stars 0 forks source link

Add pinch-zoom/drag of entire canvas #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If the user pinch-zooms or drags outside of an individual image in the photo 
sorter demo, the whole canvas should be zoomed/panned, not just individual 
photos.

This will require another coordinate system transform, and separate 
restrictions on what sorts of operations are valid on the canvas and on objects 
on the canvas (e.g. maybe the canvas can't be rotated, but objects can).

Original issue reported on code.google.com by luke.hutch on 30 Apr 2013 at 4:30

GoogleCodeExporter commented 9 years ago
hi 
is there already a solution?
or an idea how it works?!

Original comment by sebastia...@gmail.com on 29 Aug 2013 at 10:19

GoogleCodeExporter commented 9 years ago
You would check if the two touch points are outside all objects, then change 
the scale factor and origin of the canvas. The code is just a demo though, it 
isn't intended to be a fully-fledged canvas system, so I don't know if I will 
ever get time to implement this.

Original comment by luke.hutch on 30 Aug 2013 at 12:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thx for the reply!

My first idea or workaround was to implement a ScaleGestureDetector for scaling 
or a GestureDetecor for panning the whole canvas. The MultitouchListener only 
got the ontouchevent if it's over an object. This is not pretty because, there 
are many calls and checks if their is an object and I also have to scale and 
reposition all object.

The Second idea is to add a method "nothingToDrag(PointInfo, PositionScale)" to 
the ObjectCanvas interface. This would be called if the selectedObject is null 
on the performDragOrPinch() (Line 400). 

Did you mean that I should check the position of outside objects in the 
selectObject method (MultitouchObjectCanvas)? How I can handle this?
When I got a good solution you can use it as example!

good morning from europe;)

For further information: As base for my code I used the PhotoSample. 

Original comment by sebastia...@gmail.com on 30 Aug 2013 at 7:15