mirror of
https://github.com/rastapasta/mapscii.git
synced 2025-06-23 19:11:21 +02:00
_addBoundaries: Use safe integers as default boundary
This commit is contained in:
parent
ec0877830a
commit
91855972b8
@ -143,10 +143,11 @@ class Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _addBoundaries(deep: boolean, data) {
|
private _addBoundaries(deep: boolean, data) {
|
||||||
let minX = 2e308;
|
// 2e307 is a high number that's not Infinity.
|
||||||
let maxX = -2e308;
|
let minX = 2e307;
|
||||||
let minY = 2e308;
|
let maxX = -2e307;
|
||||||
let maxY = -2e308;
|
let minY = 2e307;
|
||||||
|
let maxY = -2e307;
|
||||||
const points = (deep ? data.points[0] : data.points);
|
const points = (deep ? data.points[0] : data.points);
|
||||||
for (const p of points) {
|
for (const p of points) {
|
||||||
if (p.x < minX) minX = p.x;
|
if (p.x < minX) minX = p.x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user