How to scale axes with different scale factor using pinch zoom?
For example, scale x axis only or scale x axis greater then y axis.
- Dmitry Kozhin asked 7 years ago
- You must login to post comments
If anyone is still looking at this like I was please check your version they have added this feature and forgot to update the documentation so please check that you are running the latest version
- Gil Goldzweig Goldbaum answered 6 years ago
- You must login to post comments
Thank you for sharing very interesting information. I have always been interested in the topic. It’s very cool to be able to create any item you want! So once again thank you! I will be glad if I help someone too. If you have problems writing all sorts of articles but you need it in your studies, I can suggest you contact them buy term paper. Have a nice day!
- nick voz answered 4 years ago
- last edited 4 years ago
- You must login to post comments
Hi Dmitry,
If you need to disable pinch zoom in X or Y direction then you can set XyDirection for PinchZoomModifier.
So if you need to pinch only x axis you just need to use code like this:
pinchZoomModifier.setXyDirection(XyDirection.XDirection);
Regarding the second part of your question – our default PinchZoomModifier implementation uses Android’s ScaleGestureDetector which doesn’t provide seperate scale factor for X and Y direction so for now it isn’t possible to pinch X and Y axes with different scale factors but it is possible to create to custom PinchZoomModifier and ajust scale factors if it is needed.
public class CustomPinchZoomModifier extends PinchZoomModifier {
/**
* Performs a zoom around the passed in point by the specified X and Y factor
*
* @param point The mouse point.
* @param xValue The x zoom factor.
* @param yValue The y zoom factor.
*/
@Override
protected void performZoom(PointF point, double xValue, double yValue) {
super.performZoom(point, xValue * 2, yValue); // double scale factor in X direction
}
}
Hope this will help you! If you have other questions please feel free to ask.
Best regards,
Yura
- Yura Khariton answered 7 years ago
- You must login to post comments
Please login first to submit.