소스 검색

Canvas2D: Fix Lines2D generation bug: https://trello.com/c/tHP48Dmd

nockawa 8 년 전
부모
커밋
e785c71312
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      canvas2D/src/Engine/babylon.lines2d.ts

+ 1 - 1
canvas2D/src/Engine/babylon.lines2d.ts

@@ -572,7 +572,7 @@
 
 
             // If an index is given we check if the two segments formed between [index+0;detectFlip+0] and [index+2;detectFlip+2] intersect themselves.
             // If an index is given we check if the two segments formed between [index+0;detectFlip+0] and [index+2;detectFlip+2] intersect themselves.
             // It should not be the case, they should be parallel, so if they cross, we switch the order of storage to ensure we'll have parallel lines
             // It should not be the case, they should be parallel, so if they cross, we switch the order of storage to ensure we'll have parallel lines
-            if (detectFlip !== undefined) {
+            if (detectFlip != 0) {
                 // Flip if intersect
                 // Flip if intersect
                 let flipOff = detectFlip * (borderMode ? 8 : 4);
                 let flipOff = detectFlip * (borderMode ? 8 : 4);
                 if (this._intersect(array[off + 0], array[off + 1], array[flipOff + 0], array[flipOff + 1], array[off + 2], array[off + 3], array[flipOff + 2], array[flipOff + 3])) {
                 if (this._intersect(array[off + 0], array[off + 1], array[flipOff + 0], array[flipOff + 1], array[off + 2], array[off + 3], array[flipOff + 2], array[flipOff + 3])) {