Procházet zdrojové kódy

feat: 图标复制采用原色

bill před 2 měsíci
rodič
revize
277d84c965

+ 8 - 9
src/core/hook/use-expose.ts

@@ -46,17 +46,16 @@ export const useAutoPaste = () => {
   paste.push({
     ["text/plain"]: {
       async handler(pos, val) {
-        console.log(val);
         if (isSvgString(val)) {
           const url = await resourceHandler(val, "svg");
-          const icon = await getIconStyle(url)
-          if (icon.fill) {
-            icon.fill = '#000000'
-          }
-          if (icon.stroke) {
-            icon.stroke = '#000000'
-          }
-          drawAPI.addShape("icon", { url, ...icon }, pos, true);
+          // const icon = await getIconStyle(url)
+          // if (icon.fill) {
+          //   icon.fill = '#000000'
+          // }
+          // if (icon.stroke) {
+          //   icon.stroke = '#000000'
+          // }
+          drawAPI.addShape("icon", { url }, pos, true);
         } else {
           drawAPI.addShape("text", { content: val }, pos, true);
         }

+ 1 - 1
src/core/html-mount/propertys/components/color.vue

@@ -6,7 +6,7 @@
       :class="{
         weight: color === '#FFFFFF' || color === null,
         tran: color === null,
-        active: (value && value.toUpperCase() === color) || (!value && !color),
+        active: (value && value.toUpperCase() === color) || value === color,
       }"
       @click="
         () => {