Revision: 4581
          http://sourceforge.net/p/jump-pilot/code/4581
Author:   michaudm
Date:     2015-12-07 21:25:19 +0000 (Mon, 07 Dec 2015)
Log Message:
-----------
Improvement of CutFeaturesTool

Modified Paths:
--------------
    
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/CutFeaturesTool.java

Modified: 
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/CutFeaturesTool.java
===================================================================
--- 
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/CutFeaturesTool.java
     2015-12-07 21:19:35 UTC (rev 4580)
+++ 
core/trunk/src/org/openjump/core/ui/plugin/edittoolbox/cursortools/CutFeaturesTool.java
     2015-12-07 21:25:19 UTC (rev 4581)
@@ -112,7 +112,7 @@
             if (this.geomSelected.contains(this.geomDraw)) {
               return;
             }
-            if (this.geomDraw.intersects(this.geomSelected)) {
+            if (!(this.geomSelected instanceof GeometryCollection) && 
this.geomDraw.intersects(this.geomSelected)) {
               if (this.geomSelected instanceof Polygon || this.geomSelected 
instanceof MultiPolygon) {
                 edtr.deleteFeature(featureSelected);
                 List<Geometry> div = splitPolygon(this.geomDraw, 
this.geomSelected);
@@ -131,13 +131,11 @@
                   featureIntersect.setGeometry(geom);
                   edtr.createFeature(featureIntersect);
                 }
-              } else if (this.geomSelected instanceof Point || 
this.geomSelected instanceof MultiPoint||this.geomSelected instanceof 
GeometryCollection ) {
-               // Points or GeometryCollections
               } else {
-                return;
+               // Point, MultiPoint, GeometryCollection : don't modify the 
selected feature
               }
             } else {
-              // Points or GeometryCollections
+              // No intersection : don't modify the selected feature
             }
           }
           
context.getLayerViewPanel().getSelectionManager().unselectItems(activeLayer);
@@ -211,6 +209,10 @@
           result.add(geometry);
         }
       }
+      if (result.size() == 1) {
+        result.clear();
+        result.add(geomSel);
+      };
       return result;
     }
 


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to