Prechádzať zdrojové kódy

fix: 去除多余代码

bill 1 rok pred
rodič
commit
e5b60b68a0

+ 2 - 3
src/board/packages/container.ts

@@ -1,4 +1,4 @@
-import { watch, watchEffect } from "vue";
+import { watch } from "vue";
 import { Attrib, ShapeType } from "../type";
 import { Layer } from "konva/lib/Layer";
 import { Entity, EntityProps, EntityType } from "./entity";
@@ -92,8 +92,7 @@ export class Container<
       this.incFactorys[key] = incEntitysFactoryGenerate(
         types[key],
         this,
-        () => {},
-        true
+        () => {}
       );
     }
   }

+ 0 - 1
src/board/packages/whole-line/service/index.ts

@@ -1,7 +1,6 @@
 export * from "./constant";
 export * from "./whole-line-base";
 export * from "./whole-line-tear-merge";
-export * from "./whole-line-normal";
 export * from "./whole-line-mouse";
 export * from "./whole-line-edit";
 export * from "./whole-line-helper";

+ 1 - 1
src/board/packages/whole-line/service/whole-line-helper.ts

@@ -13,7 +13,7 @@ import {
 } from "./whole-line-edit";
 import addMouseIco from "../../../shared/cursor/pic_pen_a.ico";
 import delMouseIco from "../../../shared/cursor/pic_pen_r.ico";
-import { getAbsoluteTransform, getRealAbsoluteSize } from "../../../shared";
+import { getRealAbsoluteSize } from "../../../shared";
 import { lineShapeFactory, pointShapeFactory } from "../style";
 import { Layer } from "konva/lib/Layer";
 import { Group } from "konva/lib/Group";

+ 0 - 20
src/board/packages/whole-line/service/whole-line-normal.ts

@@ -1,20 +0,0 @@
-import { polygonCounterclockwise } from "../../../shared/math";
-import { WholeLineAttrib } from "../view/whole-line";
-
-export const normalWholeLinePolygon = (
-  config: WholeLineAttrib,
-  polygonId: string
-) => {
-  // const polygon = config.polygons.find(({ id }) => id === polygonId);
-  // if (!polygon) return null;
-  // const points = polygon.points
-  //   .map((id) => config.points.find((point) => point.id === id))
-  //   .filter((point) => !!point);
-  // const flatPoints = points.map(({ x, y }) => [x, y]);
-  // if (!polygonCounterclockwise(flatPoints)) {
-  //   polygon.points.reverse();
-  // }
-  // // 形成闭合,需要确保整体逆时针方向,如果不是则修正
-  // if (points[0] === points[points.length - 1]) {
-  // }
-};

+ 1 - 1
src/board/plugins/history-plugin.ts

@@ -1,4 +1,4 @@
-import { reactive, watchEffect } from "vue";
+import { reactive } from "vue";
 import { Container } from "../packages";
 import { History } from "stateshot";
 import { inRevise } from "../shared";

+ 0 - 1
src/board/shared/adsorb.ts

@@ -10,7 +10,6 @@ import {
   getVerticaLineDire,
 } from "./math";
 import { MathUtils } from "three";
-import { getRealAbsoluteSize } from "./shape-helper";
 
 type AdsorbBaseProps = { tree: Container; position: number[] };
 

+ 1 - 2
src/board/shared/entity-utils.ts

@@ -57,8 +57,7 @@ export const incEntitysFactoryGenerate = <
 >(
   Type: C,
   parent?: Entity<any, any>,
-  extra?: (self: InstanceType<C>) => void,
-  dev = false
+  extra?: (self: InstanceType<C>) => void
 ) => {
   let oldAttribs: T[] = [];
 

+ 1 - 1
src/board/shared/shape-mose.ts

@@ -5,7 +5,7 @@ import { Group } from "konva/lib/Group";
 import { getAbsoluteTransform } from "./shape-helper";
 import { KonvaEventObject } from "konva/lib/Node";
 
-export const openShapeMouseStyles = <T extends Shape | Group, R>(
+export const openShapeMouseStyles = <T extends Shape | Group>(
   shape: T,
   styles: ShapeStyles,
   namespace = "mouse-style"