android-multitouch-controller icon indicating copy to clipboard operation
android-multitouch-controller copied to clipboard

Add pinch-zoom/drag of entire canvas

Open GoogleCodeExporter opened this issue 9 years ago • 5 comments

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 avatar Mar 25 '15 01:03 GoogleCodeExporter

hi 
is there already a solution?
or an idea how it works?!

Original comment by [email protected] on 29 Aug 2013 at 10:19

  • Added labels: ****
  • Removed labels: ****

GoogleCodeExporter avatar Mar 25 '15 01:03 GoogleCodeExporter

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

  • Added labels: ****
  • Removed labels: ****

GoogleCodeExporter avatar Mar 25 '15 01:03 GoogleCodeExporter

[deleted comment]

GoogleCodeExporter avatar Mar 25 '15 01:03 GoogleCodeExporter

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 [email protected] on 30 Aug 2013 at 7:15

  • Added labels: ****
  • Removed labels: ****

GoogleCodeExporter avatar Mar 25 '15 01:03 GoogleCodeExporter

Hi there, first of all thank you for the app I wonder how can I change your code to support multi touch simultaneously for several users, in other words users can zoom, rotate and drag several image simultaneously. you are using the history of every touch event in your app, how can we use the specific history for every image object in multi touch canvas? is this a good idea??

masoudmm avatar Mar 27 '16 13:03 masoudmm