I am using mxGraph to create some workflows in my application. By default the zoom In factor is 1.2. I want to restrict zooming after a certain level. How can this be achieved ?
Here goes my JSNI code:
private native void zoomInGraph(JavaScriptObject graph) /*-{
var scale = $wnd.mxGraphView.prototype.getScale();
if (scale != null && scale < 5){
graph.zoomIn();
}
}-*/;
Everytime scale returns the value as 1. I assumed after zooming in the scale value would change. Please suggest how can I achieve it.