Browse Source

添加新数据需求

bill 2 years ago
parent
commit
c20115e781
3 changed files with 33 additions and 18 deletions
  1. 1 1
      server/test/SS-t-P1d6CwREny2/attach/sceneStore
  2. 4 4
      src/graphic/Renderer/Draw.js
  3. 28 13
      src/store/sync.ts

File diff suppressed because it is too large
+ 1 - 1
server/test/SS-t-P1d6CwREny2/attach/sceneStore


+ 4 - 4
src/graphic/Renderer/Draw.js

@@ -532,15 +532,15 @@ export default class Draw {
 
   drawMagnifier(vector) {
     const ctx = this.context;
+    const [style] = help.setVectorStyle(ctx, vector);
+    const radius = vector.radius || style.radius;
     this.drawPoint({
       ...vector,
       ...vector.position,
-      radius: Style.Magnifier.radius,
+      radius,
     });
     const pt = coordinate.getScreenXY(vector.position);
     const target = coordinate.getScreenXY(vector.popPosition);
-    const [style] = help.setVectorStyle(ctx, vector);
-    const radius = help.getReal(vector.radius || style.radius);
     const offset = radius / 2;
     const targetPts =
       style === Style.Focus.Magnifier
@@ -584,7 +584,7 @@ export default class Draw {
           size * 2 * ro,
         ];
       }
-      const size = help.getReal(style.target.radius);
+      const size = style.target.radius;
       ctx.beginPath();
       ctx.arc(target.x, target.y, size, 0, 2 * Math.PI);
       ctx.clip();

+ 28 - 13
src/store/sync.ts

@@ -204,19 +204,34 @@ const syncSceneStore = () => {
     { deep: true }
   );
 };
-
-if (global.android) {
-  document.documentElement.addEventListener('focusin', ev => {
-    console.log("获得焦点")
-    console.log(ev.target)
-    global.android.inputMethodManager(true);
-  })
-  document.documentElement.addEventListener('focusout', ev => {
-    console.log("失去焦点")
-    console.log(ev.target)
-    global.android.inputMethodManager(false);
-  })
-}
+//
+// // if (global.android) {
+//   const isEditInput = (dom: HTMLElement) => {
+//     const tagName = dom.tagName.toUpperCase();
+//     const isInput = tagName === "INPUT"
+//     const isTextarea = tagName === "TEXTAREA"
+//     console.log(isInput && dom.getAttribute("type") === "text")
+//     if (!(isInput && dom.getAttribute("type") === "text") && !isTextarea) {
+//       return false;
+//     }
+//     console.log("???")
+//     return !dom.hasAttribute("readonly")
+//   }
+//   document.documentElement.addEventListener('focusin', ev => {
+//     console.log("获得焦点")
+//     console.log(ev.target)
+//     if (isEditInput(ev.target as HTMLElement)) {
+//       global.android.inputMethodManager(true);
+//     }
+//   })
+//   document.documentElement.addEventListener('focusout', ev => {
+//     console.log("失去焦点")
+//     console.log(ev.target)
+//     if (isEditInput(ev.target as HTMLElement)) {
+//       global.android.inputMethodManager(false);
+//     }
+//   })
+// // }
 
 loadStore().catch((e) => {
   console.error(e);