This commit is contained in:
Spynder
2025-05-04 22:40:44 +03:00
parent 275eef597b
commit 6454af90d3
207 changed files with 88 additions and 10279 deletions

View File

@ -1,6 +1,7 @@
import { Graphics } from "pixi.js";
import { useCallback } from "react";
import { PATH_COLOR, PATH_WIDTH } from "./Constants";
import { coordinatesToLocal } from "./utils";
interface TravelPathProps {
@ -13,9 +14,11 @@ export function TravelPath({
const draw = useCallback((g: Graphics) => {
g.clear();
g.moveTo(points[0].x, points[0].y);
const coordStart = coordinatesToLocal(points[0].x, points[0].y);
g.moveTo(coordStart.x, coordStart.y);
for (let i = 1; i < points.length - 1; i++) {
g.lineTo(points[i].x, points[i].y);
const coordinates = coordinatesToLocal(points[i].x, points[i].y);
g.lineTo(coordinates.x, coordinates.y);
}
g.stroke({
color: PATH_COLOR,