Explorar o código

Merge pull request #9240 from bghgary/polygon-fix

Remove epsilon check for PolygonPoints.add
David Catuhe %!s(int64=4) %!d(string=hai) anos
pai
achega
5093f53ad8
Modificáronse 2 ficheiros con 4 adicións e 5 borrados
  1. 1 0
      dist/preview release/what's new.md
  2. 3 5
      src/Meshes/polygonMesh.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -376,3 +376,4 @@
 - Fix width/height GUI container computation to take into account paddings when `adaptWithToChildren = true` ([Popov72](https://github.com/Popov72))
 - Fix width/height GUI container computation to take into account paddings when `adaptWithToChildren = true` ([Popov72](https://github.com/Popov72))
 - `smoothstep` in NME is now taking any type of parameters for its `value` input. If you use generated code from the NME ("Generate code" button), you may have to move the smoothstep output connection AFTER the input connections ([Popov72](https://github.com/Popov72))
 - `smoothstep` in NME is now taking any type of parameters for its `value` input. If you use generated code from the NME ("Generate code" button), you may have to move the smoothstep output connection AFTER the input connections ([Popov72](https://github.com/Popov72))
 - `SoundTrack.RemoveSound` and `SoundTrack.AddSound` were renamed to `SoundTrack.removeSound` and `SoundTrack.addSound` ([Deltakosh](https://github.com/deltakosh))
 - `SoundTrack.RemoveSound` and `SoundTrack.AddSound` were renamed to `SoundTrack.removeSound` and `SoundTrack.addSound` ([Deltakosh](https://github.com/deltakosh))
+- `PolygonPoints.add` no longer filters out points that are close to the first point ([bghgary](https://github.com/bghgary))

+ 3 - 5
src/Meshes/polygonMesh.ts

@@ -31,11 +31,9 @@ class PolygonPoints {
 
 
         var result = new Array<IndexedVector2>();
         var result = new Array<IndexedVector2>();
         originalPoints.forEach((point) => {
         originalPoints.forEach((point) => {
-            if (result.length === 0 || !point.equalsWithEpsilon(result[0])) {
-                var newPoint = new IndexedVector2(point, this.elements.length);
-                result.push(newPoint);
-                this.elements.push(newPoint);
-            }
+            var newPoint = new IndexedVector2(point, this.elements.length);
+            result.push(newPoint);
+            this.elements.push(newPoint);
         });
         });
 
 
         return result;
         return result;