Copy link to clipboard
Copied
Hi!
I have a android air application that has a listbox witch you can zoom with touch.
But there are an issue with that that i can't solve:
List with no zoom:
List with zoom:
As you can see, the first listbox cell has much height than the other ones (and the x/y coordinates are diferent).
The code to zoom the list box is that:
function onZoom(e:TransformGestureEvent):void {
if(touchList.scaleX>0.8 && touchList.scaleX<1.5)
{
touchList.scaleX *= (e.scaleX+e.scaleY)/2;
touchList.scaleY *= (e.scaleX+e.scaleY)/2;
}
else if (touchList.scaleX<0.8)
{
touchList.scaleX = 0.801;
touchList.scaleY =touchList.scaleX;
}
else if (touchList.scaleX>1.5)
{
touchList.scaleX = 1.499;
touchList.scaleY =touchList.scaleX;
}
}
How could i scale the listbox keeping an equal cell height and without changing the x,y positions?
Thank you very much
Copy link to clipboard
Copied
I do not see anything that changed relative to the x/y positioning, but if it is, the x/y positioning appearing differently is likely due to the x/y origin not being at the corner. If you do not want the height to change then do not scale it, but do expect the text to look stretched if you only expand the X scale..
Copy link to clipboard
Copied
Hi!
Thank you for the answer.
Below, you have an image of the list without a mask.
As you can see, the beginning of the list is below the beginning of the backgroun (when it should match).
I supose that the x/y origin is not at the corner but how do i change that?
Is there any other method to solve this problem?
Thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now