Question

I developed a mobile app inside Adobe Flex (4.6) and it includes using pinch-to-zoom functionality to zoom in on pictures to make it easier to read words in the pictures. In previous android versions (2.1 to 2.3.3 and 2.3.4 if you're running cyanogenmod) the pinch-to-zoom works fine. But if the app is run on an ICS (Android 4.x) device, the axes seem to handle the enlargement of the picture individually. i.e. when you move your fingers apart horizontally, the image gets very wide, but stays the same vertical size, and vice versa.

First, does anyone know why this is happening?

And second, does anyone know of a way to fix it to work as it did before?

I will update to include screenshots.

Update: I have confirmed this is also an issue with Honeycomb. i.e., 3.x OS acts the same as 4.x ICS.

Sense, running the latest HTC update: Original imagePinch-to-Zoompinch-to-zoom-out

ICS, on AOKP, but verified this is an issue with standard ICS distros as well: ICS pinch-to-zoom stretchcan stretch any way...gets a little disorienting

Was it helpful?

Solution

Solved this. Code was previously:

        protected function onZoom(e:TransformGestureEvent, img:Image):void
        {
                DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleY);
        }

change the final e.scaleY to e.scaleX. This makes it scale based on only one portion of the zoom (in the x direction) and scales both X and Y accordingly. Not exactly perfect, but it works very well in practice.

Final code is this:

        protected function onZoom(e:TransformGestureEvent, img:Image):void
        {
                DynamicRegistration.scale(img, new Point(e.localX, e.localY), img.scaleX*e.scaleX, img.scaleY*e.scaleX);
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top