squishjs 0.7.53 → 0.7.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/squish.js +7 -3
package/package.json
CHANGED
package/src/squish.js
CHANGED
|
@@ -56,8 +56,8 @@ const unsquish = (squished) => {
|
|
|
56
56
|
while(squishedIndex < squished.length) {
|
|
57
57
|
|
|
58
58
|
const subFrameType = squished[squishedIndex];
|
|
59
|
-
const subFrameLength = squished[squishedIndex + 1];
|
|
60
|
-
const subFrame = squished.slice(squishedIndex +
|
|
59
|
+
const subFrameLength = squished[squishedIndex + 1] + squished[squishedIndex + 2];
|
|
60
|
+
const subFrame = squished.slice(squishedIndex + 3, squishedIndex + subFrameLength);
|
|
61
61
|
|
|
62
62
|
if (!typeToSquishMap[subFrameType]) {
|
|
63
63
|
console.warn("Unknown sub frame type " + subFrameType);
|
|
@@ -115,7 +115,11 @@ const squish = (entity, scale = null) => {
|
|
|
115
115
|
const attr = internalNode[key];
|
|
116
116
|
if (attr !== undefined && attr !== null) {
|
|
117
117
|
const squished = squishSpec[key].squish(attr, scale, internalNode);
|
|
118
|
-
|
|
118
|
+
const totalLength = squished.length + 3;
|
|
119
|
+
const rightMost = Math.min(255, totalLength);
|
|
120
|
+
const leftMost = Math.min(255, Math.max(0, totalLength - 255));
|
|
121
|
+
|
|
122
|
+
squishedPieces.push([squishSpec[key]['type'], leftMost, rightMost, ...squished]);
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
}
|