Forráskód Böngészése

Merge pull request #6986 from Poolminer/master

Path2 length computation fix
David Catuhe 5 éve
szülő
commit
d253695f65
2 módosított fájl, 2 hozzáadás és 1 törlés
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Maths/math.path.ts

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

@@ -192,6 +192,7 @@
 - Fixed `TextureLinkLineComponent` to no longer invert inspector-loaded textures ([Drigax](https://github.com/drigax))
 - Fixed a single frame drop after leaving webxr on some devices ([RaananW](https://github.com/RaananW/))
 - Fixed bug where vignette aspect ratio would be wrong when rendering direct to canvas
+- Fixed Path2 length computation ([Poolminer](https://github.com/Poolminer/))
 
 ## Breaking changes
 

+ 1 - 1
src/Maths/math.path.ts

@@ -265,7 +265,7 @@ export class Path2 {
     public length(): number {
         var result = this._length;
 
-        if (!this.closed) {
+        if (this.closed) {
             var lastPoint = this._points[this._points.length - 1];
             var firstPoint = this._points[0];
             result += (firstPoint.subtract(lastPoint).length());