bill пре 2 месеци
родитељ
комит
d2373b5c48
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/example/platform/platform-resource.ts

+ 3 - 3
src/example/platform/platform-resource.ts

@@ -4,6 +4,7 @@ import { validNum } from "@/utils/shared";
 import { aiIconMap, iconGroups } from "../constant";
 import { Euler, MathUtils, Object3D, Quaternion, Vector3 } from "three";
 import { getSvgContent, parseSvgContent } from "@/utils/resource";
+import { getIconStyle } from "@/core/components/icon";
 
 export enum SCENE_TYPE {
   fuse = "fuse",
@@ -348,9 +349,8 @@ export const taggingGets = {
                 } else {
                   item.rotate = Math.PI / 2;
                   loadPromises.push(
-                    getSvgContent(item.url).then((svgContent) => {
-                      const content = parseSvgContent(svgContent);
-                      item.position.x += (content.height / content.width * wh) / 2;
+                    getIconStyle(item.url, wh, wh).then((style) => {
+                      item.position.x += style.height / 2;
                     }).catch(() => {})
                   );
                 }