final double r = Math.sqrt(x * x + y * y);
final Dimension originalSize = ((ScalableComponent) component).getOriginalSize();
final int w = originalSize.width;
final int h = originalSize.height;
final double r0 = Math.sqrt(w * w + h * h);
final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, component);
final float zoom = mapView.getZoom();
final float modelSize = (float) (r / r0 / zoom);
setZoom(mapView.getModeController(), mapView.getModel(), (ExternalResource) component
.getClientProperty(ExternalResource.class), modelSize);
sizeChanged = false;
}
else {
imagePopupMenu.maybeShowPopup(e);