bill 2 tháng trước cách đây
mục cha
commit
bea20d1e0b

+ 1 - 1
src/core/components/icon/index.ts

@@ -54,7 +54,7 @@ export const getMouseStyle = (data: IconData) => {
 
 
 export type IconData = Partial<typeof defaultStyle> &
 export type IconData = Partial<typeof defaultStyle> &
   BaseItem & Size & {
   BaseItem & Size & {
-    fill?: string;
+    fill?: string | null;
     stroke?: string;
     stroke?: string;
     name?: string
     name?: string
     strokeWidth?: number;
     strokeWidth?: number;

+ 2 - 2
src/core/hook/use-expose.ts

@@ -48,7 +48,7 @@ export const useAutoPaste = () => {
         console.log(val);
         console.log(val);
         if (isSvgString(val)) {
         if (isSvgString(val)) {
           const url = await resourceHandler(val, "svg");
           const url = await resourceHandler(val, "svg");
-          drawAPI.addShape("icon", { url, stroke: themeColor }, pos, true);
+          drawAPI.addShape("icon", { url, stroke: themeColor, fill: null }, pos, true);
         } else {
         } else {
           drawAPI.addShape("text", { content: val }, pos, true);
           drawAPI.addShape("text", { content: val }, pos, true);
         }
         }
@@ -59,7 +59,7 @@ export const useAutoPaste = () => {
       async handler(pos, val, type) {
       async handler(pos, val, type) {
         const url = await resourceHandler(val, type);
         const url = await resourceHandler(val, type);
         if (type.includes("svg")) {
         if (type.includes("svg")) {
-          drawAPI.addShape("icon", { url, stroke: themeColor }, pos, true);
+          drawAPI.addShape("icon", { url, stroke: themeColor, fill: null }, pos, true);
         } else {
         } else {
           const image = await getImage(url);
           const image = await getImage(url);
           drawAPI.addShape(
           drawAPI.addShape(