/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/maths/__tests__/Triangle.test.ts
21 строка
738 B
spokodev
fix(maths): use the correct vertex for the first edge in Triangle.strokeContains (#12105)
13 июл 2026, 11:37
Не верифицирован
13 июл 2026, 11:37
18af4a2
Код
Авторство
О чём код?
import { Triangle } from '../shapes/Triangle'; describe('Triangle', () => { it('should stroke-contain a point on the first edge', () => { // vertices (0,0), (100,20), (50,100); first edge is (0,0)->(100,20) const triangle = new Triangle(0, 0, 100, 20, 50, 100); // (50,10) is the midpoint of the first edge, so it lies on the stroke expect(triangle.strokeContains(50, 10, 4)).toBe(true); }); it('should not stroke-contain an interior point far from every edge', () => { const triangle = new Triangle(0, 0, 100, 20, 50, 100); // (50,50) is well inside the triangle, far from all three edges expect(triangle.strokeContains(50, 50, 4)).toBe(false); }); });