Skip to main content
Participating Frequently
January 16, 2017
Question

Zooming ListBox issue

  • January 16, 2017
  • 1 reply
  • 265 views

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:

Sem_Título.png

List with zoom:

Sem_T_tulo2.png

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

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
January 17, 2017

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..

Participating Frequently
January 17, 2017

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?

Sem_T_tulo.png

Thank you!