map 2
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user