Move drawing simplify away from grid dependent scaling
This commit is contained in:
parent
f5ccbe8f8f
commit
948be7cac2
@ -119,8 +119,7 @@ function MapDrawing({
|
|||||||
}
|
}
|
||||||
const simplified = simplifyPoints(
|
const simplified = simplifyPoints(
|
||||||
[...prevPoints, brushPosition],
|
[...prevPoints, brushPosition],
|
||||||
gridCellNormalizedSize,
|
1 / 1000 / stageScale
|
||||||
stageScale
|
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...prevShape,
|
...prevShape,
|
||||||
|
@ -176,8 +176,7 @@ function MapFog({
|
|||||||
}
|
}
|
||||||
const simplified = simplifyPoints(
|
const simplified = simplifyPoints(
|
||||||
[...prevPoints, brushPosition],
|
[...prevPoints, brushPosition],
|
||||||
gridCellNormalizedSize,
|
1 / 1000 / stageScale
|
||||||
stageScale / 4
|
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...prevShape,
|
...prevShape,
|
||||||
|
@ -192,18 +192,13 @@ export function getUpdatedShapeData(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultSimplifySize = 1 / 100;
|
|
||||||
/**
|
/**
|
||||||
* Simplify points to a grid size
|
* Simplify points to a grid size
|
||||||
* @param {Vector2[]} points
|
* @param {Vector2[]} points
|
||||||
* @param {Vector2} gridCellSize
|
* @param {number} tolerance
|
||||||
* @param {number} scale
|
|
||||||
*/
|
*/
|
||||||
export function simplifyPoints(points, gridCellSize, scale) {
|
export function simplifyPoints(points, tolerance) {
|
||||||
return simplify(
|
return simplify(points, tolerance);
|
||||||
points,
|
|
||||||
(Vector2.min(gridCellSize) * defaultSimplifySize) / scale
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user