|
|
@@ -112,65 +112,65 @@ const getCoverShapes = (cover: SceneResource["cover"]) => {
|
|
|
return { geo, thumb };
|
|
|
};
|
|
|
|
|
|
-const getTaggingBorderShapes = async (taggings: SceneResource["taggings"]) => {
|
|
|
- const icons: IconData[] = [];
|
|
|
- const images: ImageData[] = [];
|
|
|
- const texts: TextData[] = [];
|
|
|
- const now = Date.now();
|
|
|
- const reqs: Promise<any>[] = [];
|
|
|
-
|
|
|
- for (let ndx = 0; ndx < taggings.length; ndx++) {
|
|
|
- const item = taggings[ndx];
|
|
|
- const mat = new Transform(item.mat);
|
|
|
-
|
|
|
- if (!item.mat && item.position) {
|
|
|
- mat.translate(item.position.x, item.position.y);
|
|
|
- item.rotate && mat.rotate(item.rotate);
|
|
|
- }
|
|
|
-
|
|
|
- if (item.isText) {
|
|
|
- texts.push({
|
|
|
- ...getBaseItem(),
|
|
|
- ...textDefaultStyle,
|
|
|
- key: item.key,
|
|
|
- content: item.url,
|
|
|
- zIndex: 1,
|
|
|
- mat: mat.m,
|
|
|
- createTime: now + taggings.length + ndx,
|
|
|
- });
|
|
|
- continue;
|
|
|
- }
|
|
|
- const shape = {
|
|
|
- ...getBaseItem(),
|
|
|
- ...(item.size || { width: 100, height: 100 }),
|
|
|
- name: item.name,
|
|
|
- key: item.key,
|
|
|
- createTime: now + ndx,
|
|
|
- url: item.url,
|
|
|
- mat: mat.m,
|
|
|
- zIndex: 1,
|
|
|
- };
|
|
|
-
|
|
|
- if (!item.url.includes(".svg")) {
|
|
|
- images.push(shape);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- reqs.push(
|
|
|
- getIconStyle(item.url, shape.width, shape.height, item.fixed)
|
|
|
- .then((style) => {
|
|
|
- icons.push({ ...shape, ...style });
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- );
|
|
|
- }
|
|
|
- await Promise.all(reqs);
|
|
|
- return {
|
|
|
- texts,
|
|
|
- images,
|
|
|
- icons,
|
|
|
- };
|
|
|
-};
|
|
|
+// const getTaggingBorderShapes = async (taggings: SceneResource["taggings"]) => {
|
|
|
+// const icons: IconData[] = [];
|
|
|
+// const images: ImageData[] = [];
|
|
|
+// const texts: TextData[] = [];
|
|
|
+// const now = Date.now();
|
|
|
+// const reqs: Promise<any>[] = [];
|
|
|
+
|
|
|
+// for (let ndx = 0; ndx < taggings.length; ndx++) {
|
|
|
+// const item = taggings[ndx];
|
|
|
+// const mat = new Transform(item.mat);
|
|
|
+
|
|
|
+// if (!item.mat && item.position) {
|
|
|
+// mat.translate(item.position.x, item.position.y);
|
|
|
+// item.rotate && mat.rotate(item.rotate);
|
|
|
+// }
|
|
|
+
|
|
|
+// if (item.isText) {
|
|
|
+// texts.push({
|
|
|
+// ...getBaseItem(),
|
|
|
+// ...textDefaultStyle,
|
|
|
+// key: item.key,
|
|
|
+// content: item.url,
|
|
|
+// zIndex: 1,
|
|
|
+// mat: mat.m,
|
|
|
+// createTime: now + taggings.length + ndx,
|
|
|
+// });
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+// const shape = {
|
|
|
+// ...getBaseItem(),
|
|
|
+// ...(item.size || { width: 100, height: 100 }),
|
|
|
+// name: item.name,
|
|
|
+// key: item.key,
|
|
|
+// createTime: now + ndx,
|
|
|
+// url: item.url,
|
|
|
+// mat: mat.m,
|
|
|
+// zIndex: 1,
|
|
|
+// };
|
|
|
+
|
|
|
+// if (!item.url.includes(".svg")) {
|
|
|
+// images.push(shape);
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+
|
|
|
+// reqs.push(
|
|
|
+// getIconStyle(item.url, shape.width, shape.height, item.fixed)
|
|
|
+// .then((style) => {
|
|
|
+// icons.push({ ...shape, ...style });
|
|
|
+// })
|
|
|
+// .catch(() => {})
|
|
|
+// );
|
|
|
+// }
|
|
|
+// await Promise.all(reqs);
|
|
|
+// return {
|
|
|
+// texts,
|
|
|
+// images,
|
|
|
+// icons,
|
|
|
+// };
|
|
|
+// };
|
|
|
|
|
|
const getTaggingShapes = async (taggings: SceneResource["taggings"]) => {
|
|
|
const icons: IconData[] = [];
|