Revision 45610 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/fmap/mapcontrol/MapControl.java

View differences:

MapControl.java
1714 1714
        public void mouseClicked(MouseEvent e) {
1715 1715
            try {
1716 1716
                if (currentMapTool != null) {
1717
                    if (mapAdjustedPoint!=null) {
1718
                        Point2D mp = vp.fromMapPoint(mapAdjustedPoint);
1719
                        e.translatePoint((int) mp.getX() - e.getX(), 
1720
                                (int) mp.getY()- e.getY());
1721
                    }
1717 1722
                    currentMapTool.mouseClicked(e);
1718 1723
                }
1719 1724
                Point2D p;
......
2582 2587
     * @param point
2583 2588
     *            current mouse 2D position
2584 2589
     */
2585
    public void calculateSnapPoint(Point point) {
2590
    public void calculateSnapPoint(Point2D point) {
2586 2591
        // Se comprueba el ajuste a rejilla
2587 2592

  
2588 2593
        Point2D gridAdjustedPoint = vp.toMapPoint(point);
......
2661 2666
    public Point2D getMapAdjustedPoint() {
2662 2667
        return mapAdjustedPoint;
2663 2668
    }
2669
    
2670
    public Point2D convertToMapPoint(Point2D point, boolean useSnapping) {
2671
        Point2D p;
2672
        if (useSnapping) {
2673
            this.calculateSnapPoint(point);
2674
            p = this.getMapAdjustedPoint();
2675
            if (p==null) {
2676
               p = this.getViewPort().toMapPoint(point);
2677
            }
2678
         } else {
2679
             p = this.getViewPort().toMapPoint(point);
2680
         }
2681
       return p;
2682
     }
2664 2683

  
2665 2684
    /**
2666 2685
     * Gets the selected point. If the snapping is enabled

Also available in: Unified diff