Revision 9433

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutZooms.java
461 461
        for (int i = 0; i < fframes.length; i++) {
462 462
            if (fframes[i] instanceof IFFrameUseFMap) {
463 463
                IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i];
464
                Point2D px1 = FLayoutFunctions.toMapPoint(p1, fframe.getATMap());
465
                Point2D px2 = FLayoutFunctions.toMapPoint(p2, fframe.getATMap());
466
                fframe.movePoints(px1, px2);
464
                if (fframe.getATMap()!=null) {
465
	                Point2D px1 = FLayoutFunctions.toMapPoint(p1, fframe.getATMap());
466
	                Point2D px2 = FLayoutFunctions.toMapPoint(p2, fframe.getATMap());
467
	                fframe.movePoints(px1, px2);
468
                }
467 469
            }
468 470
        }
469 471
    }
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutFunctions.java
263 263
				IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i];
264 264

  
265 265
				if (((IFFrame)fframe).getSelected() != IFFrame.NOSELECT) {
266
					Rectangle2D.Double r = new Rectangle2D.Double();
267
					Rectangle2D extent = fframe.getMapContext().getViewPort()
268
											   .getExtent();
269
					Point2D mp1 = toMapPoint(p1, fframe.getATMap());
270
					Point2D mp2 = toMapPoint(p2, fframe.getATMap());
271
					r.x = extent.getX() - (mp2.getX() - mp1.getX());
272
					r.y = extent.getY() - (mp2.getY() - mp1.getY());
273
					r.width = extent.getWidth();
274
					r.height = extent.getHeight();
275
					fframe.getMapContext().getViewPort().setExtent(r);
276
					fframe.refresh();
266
					 if (fframe.getATMap()!=null) {
267
						Rectangle2D.Double r = new Rectangle2D.Double();
268
						Rectangle2D extent = fframe.getMapContext().getViewPort()
269
												   .getExtent();
270
						Point2D mp1 = toMapPoint(p1, fframe.getATMap());
271
						Point2D mp2 = toMapPoint(p2, fframe.getATMap());
272
						r.x = extent.getX() - (mp2.getX() - mp1.getX());
273
						r.y = extent.getY() - (mp2.getY() - mp1.getY());
274
						r.width = extent.getWidth();
275
						r.height = extent.getHeight();
276
						fframe.getMapContext().getViewPort().setExtent(r);
277
						fframe.refresh();
278
					 }
277 279
				}
278 280
			}
279 281
		}

Also available in: Unified diff