Ignore:
Timestamp:
2011-11-24T10:35:55+01:00 (13 years ago)
Author:
larry0ua
Message:

'PicLayer - selection points are enlarged to 10 px'

Location:
applications/editors/josm/plugins/piclayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/build.xml

    r27122 r27139  
    2222-->
    2323<project name="PicLayer" default="dist" basedir=".">
    24     <property name="commit.message" value="PicLayer - toolbar buttons are hidden when layer is not active"/>
     24    <property name="commit.message" value="PicLayer - selection points are enlarged to 10 px"/>
    2525    <property name="plugin.main.version" value="4549"/>
    2626    <!--
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java

    r27120 r27139  
    515515            return null;
    516516
     517        Point2D selected = null;
    517518        try {
    518519            Point2D pressed = transformPoint(point);
     520            double mindist = 10;
    519521            for (Point2D p : transformer.getOriginPoints())
    520                 if (p.distance(pressed) <= 4.0) // if user clicked to select some of origin point
    521                     return p;
     522                if (p.distance(pressed) < mindist) { // if user clicked to select some of origin point
     523                    selected = p;
     524                    mindist = p.distance(pressed);
     525                }
     526            return selected;
    522527        } catch (NoninvertibleTransformException e) {
    523528            e.printStackTrace();
    524529        }
    525         return null;
     530        return selected;
    526531    }
    527532}
Note: See TracChangeset for help on using the changeset viewer.