synchronized (NavigationUpdateThread.class) {
this.updateDelay = updateDelay;
double targetZoom;
if (command == null) {
TransformDrawCommand transformDrawCommand = new TransformDrawCommand();
command = transformDrawCommand;
if (fixedPoint == null) {
fixedPoint = new Point(context.getViewportPane().getWidth() / 2, context
.getViewportPane().getHeight() / 2);
}
transformDrawCommand.fixPoint(fixedPoint);
this.fixedPoint = context.pixelToWorld(fixedPoint.x, fixedPoint.y);
targetZoom = context.calculateZoomLevel(previousZoom, zoomChange,this.fixedPoint,false, change != 0);
if(Math.abs(targetZoom - previousZoom) > 0.0001) {
transformDrawCommand.zoom(targetZoom, targetZoom);
context.sendASyncCommand(transformDrawCommand);
}
} else {
targetZoom = context.calculateZoomLevel(previousZoom,zoomChange,this.fixedPoint,false, change != 0);
command.zoom(targetZoom, targetZoom);