Browse Source

feat: 双向箭头改单向不生效

jinx 2 năm trước cách đây
mục cha
commit
28a076a34a
2 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 2 1
      src/graphic/ListenLayer.js
  2. 3 1
      src/views/graphic/geos/arrow.vue

+ 2 - 1
src/graphic/ListenLayer.js

@@ -12,6 +12,7 @@ import { draw } from "./Renderer/Draw.js";
 import { edgeService } from "./Service/EdgeService";
 import VectorCategory from "./enum/VectorCategory";
 import LayerEvents from "./enum/LayerEvents";
+import Style from "./CanvasStyle";
 export default class ListenLayer {
   constructor(canvas, newsletter, graphicState) {
     this.modifyPoint = null;
@@ -977,7 +978,7 @@ export default class ListenLayer {
           y: magnifier.popPosition.y / coordinate.ratio,
         });
         distance = this.getDistance(position, popPosition);
-        if (distance < 100 * coordinate.ratio) {
+        if (distance < Style.Magnifier.target.radius) {
           //圆圈的半径
           magnifierInfo = {
             magnifierId: magnifierId,

+ 3 - 1
src/views/graphic/geos/arrow.vue

@@ -24,7 +24,8 @@ import VectorCategory from "@/graphic/enum/VectorCategory";
 const props = defineProps<{geo: FocusVector}>()
 const vector = computed(() => dataService.getLine(props.geo.vectorId))
 const color = ref("#000000")
-const type = ref("SingleArrowLine")
+const type = ref(props.geo.category || "SingleArrowLine")
+console.log(type.value)
 useChange(() => {
   color.value = vector.value.color
   color.value = vector.value.category
@@ -40,6 +41,7 @@ const syncVector = ([color, type]) => {
 
 watch(() => [color.value, type.value], debounce(syncVector, 500))
 
+
 const typeMenus = ref<UnwrapRef<typeof menus>>()
 const menus = ref([
   {