Ignore:
Timestamp:
2010-11-17T11:53:34+01:00 (14 years ago)
Author:
ocroquette
Message:

Precision of rotation and scaling is now increased when pressing the SHIFT key

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

Legend:

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

    r22549 r24288  
    100100    -->
    101101        <target name="revision">
    102 
    103                 <!-- extract the SVN revision information for file build.number -->
    104                 <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    105                         <env key="LANG" value="C"/>
    106                         <arg value="info"/>
    107                         <arg value="--xml"/>
    108                         <arg value="."/>
    109                 </exec>
    110102                <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    111                 <delete file="REVISION"/>
    112103        </target>
    113104
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/RotatePictureAction.java

    r23190 r24288  
    8787        // Rotate the picture
    8888        if(mb_dragging) {
    89             // TODO: Magic number
    90             m_currentLayer.rotatePictureBy( ( e.getY() - m_prevY ) / 10.0 );
     89            double factor;
     90            if ( ( e.getModifiersEx() & e.SHIFT_DOWN_MASK ) != 0 ) {
     91                factor = Main.pref.getDouble("piclayer.rotatefactors.high_precision", 100.0);
     92            }
     93            else {
     94                factor = Main.pref.getDouble("piclayer.rotatefactors.low_precision", 10.0 );
     95            }           
     96            m_currentLayer.rotatePictureBy( ( e.getY() - m_prevY ) / factor );
    9197            m_prevY = e.getY();
    9298            Main.map.mapView.repaint();
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/ScalePictureActionAbstract.java

    r23190 r24288  
    8585        // Scale the picture
    8686        if(mb_dragging) {
    87             doTheScale( ( e.getY() - m_prevY ) / 500.0 );
     87            double factor;
     88            if ( ( e.getModifiersEx() & e.SHIFT_DOWN_MASK ) != 0 ) {
     89                factor = Main.pref.getDouble("piclayer.scalefactors.high_precision", 4000);
     90            }
     91            else {
     92                factor = Main.pref.getDouble("piclayer.scalefactors.low_precision", 400);
     93            }           
     94            doTheScale( ( e.getY() - m_prevY ) / factor );
    8895            m_prevY = e.getY();
    8996            Main.map.mapView.repaint();
Note: See TracChangeset for help on using the changeset viewer.