Comparing version 0.5.0 to 0.5.1
{ | ||
"name": "squishjs", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "squish & unsquish stuff", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -68,3 +68,2 @@ const InternalGameNode = require("./InternalGameNode"); | ||
for (const i in originalCoords) { | ||
Math.floor(p.x), Math.round(100 * (p.x - Math.floor(p.x))) | ||
squished[2 * i] = Math.floor(originalCoords[i]); | ||
@@ -71,0 +70,0 @@ squished[(2 * i) + 1] = Math.round(100 * (originalCoords[i] - Math.floor(originalCoords[i]))); |
const rectangle = (startX, startY, width, height) => { | ||
return [ | ||
startX, startY, | ||
startX + width, startY, | ||
startX + width, startY + height, | ||
startX, startY + height, | ||
startX, startY, | ||
[startX, startY], | ||
[startX + width, startY], | ||
[startX + width, startY + height], | ||
[startX, startY + height], | ||
[startX, startY], | ||
]; | ||
@@ -9,0 +9,0 @@ }; |
@@ -18,2 +18,11 @@ const { squish, unsquish } = require('../src/squish'); | ||
assert(!!unsquished[key] === expectedValue); | ||
} else if (key === 'coordinates2d') { | ||
if (!preSquish.coordinates2d) { | ||
assert(!unsquished.coordinates2d); | ||
} else { | ||
const preSquishFlat = preSquish.coordinates2d.flat(); | ||
for (let i = 0; i < unsquished.coordinates2d.length; i++) { | ||
assert(preSquishFlat[i] === unsquished.coordinates2d[i]); | ||
} | ||
} | ||
} else if (key === 'input' || key == 'text') { | ||
@@ -20,0 +29,0 @@ // TODO: Handle all of this in a more generic way |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28799
842