IlvZoomViewInteractor does not maintain the aspect ratio that was set on it

Article ID: 2274
Last updated: 29 May, 2018
Article ID: 2274
Last updated: 29 May, 2018
Revision: 3
Views: 505
Posted: 13 Oct, 2004
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

Why my IlvZoomViewInteractor does not maintain the aspect ratio that I set on it?

Cause

You initialize a zoom view interactor and set the aspect ratio for the dragged rectangle. Then push the interactor on the view but at runtime the interactor does not keep the aspect ratio you just set.

Answer

What happens is that when the zoom view interactor is attached to the manager view:

  1. If this view is not keeping aspect ratio:

    The interactor aspect ratio will be set to 0, which means no aspect ratio should be kept.

  2. If the view is keeping the ratio []and[] the view has been made visible:

    The interactor aspect ratio is the width/height ratio of the view's dimension.

  3. If the view is keeping the ratio []and[] the view has []not[] been made visible:

    The aspect ratio set on the interactor will be kept as expected.

Action

In order to be in the safe side, you should set aspect ratio of the interactor after it is attached to the view. For example:

IlvZoomViewInteractor zoomer = new IlvZoomViewInteractor();

managerView.pushInteractor(zoomer);

zoomer.setRectangleAspectRatio(1.0f);

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2274
Last updated: 29 May, 2018
Revision: 3
Views: 505
Posted: 13 Oct, 2004 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category