@@ -48,7 +48,7 @@ const selectHandler = async (val: string) => {
if (menu.handler) {
menu.handler(props.draw);
nextTick(() => (active.value = undefined));
- } else {
+ } else if (menu.payload) {
props.draw.enterDrawShape(menu.payload.type, menu.payload.preset, menu.single);
}
};
@@ -52,13 +52,21 @@ const drawIcon = async (url: string, name: string, item: any) => {
size.width = (maxSize / svgContent.height) * svgContent.width;
+ const color = {
+ fill: svgContent.paths[0]?.fill,
+ stroke: svgContent.paths[0]?.stroke,
+ };
+ if (!color.fill && !color.stroke) {
+ color.stroke = "#000000";
+ }
+
props.draw.enterDrawShape(
"icon",
{
url,
...size,
name,
- fill: "#000000",
+ ...color,
...(item.parse || {}),
},
true