任一存 преди 2 години
родител
ревизия
c610cf4dac
променени са 1 файла, в които са добавени 10 реда и са изтрити 10 реда
  1. 10 10
      src/views/gui/LandmarkEditor.vue

+ 10 - 10
src/views/gui/LandmarkEditor.vue

@@ -109,7 +109,7 @@
 <script>
 const AlloyFinger = require("alloyfinger")
 const Transform = require("css3transform")
-const To = require("@/utils/to.js")
+// const To = require("@/utils/to.js")
 import html2canvas from "html2canvas"
 
 export default {
@@ -126,9 +126,9 @@ export default {
     }
   },
   mounted() {
-    function ease(x) {
-      return Math.sqrt(1 - Math.pow(x - 1, 2))
-    }
+    // function ease(x) {
+    //   return Math.sqrt(1 - Math.pow(x - 1, 2))
+    // }
 
     var initScale = 1
 
@@ -139,7 +139,7 @@ export default {
     new AlloyFinger(target, {
     // 多点触摸时重置状态
       multipointStart: function() {
-        To.stopAll()
+        // To.stopAll()
         initScale = target.scaleX
       },
       // 旋转
@@ -153,7 +153,7 @@ export default {
       // 触摸结束时的动画
       multipointEnd: function() {
         // 使用To.js来管理js开启的动画
-        To.stopAll()
+        // To.stopAll()
 
         // // 最小缩放到0.5倍
         // if (target.scaleX < 0.5) {
@@ -197,7 +197,7 @@ export default {
     onClickRedo() {
       this.isShowPopup = true
     },
-    garenteeValid(originalFile) { // 确保格式为jpg
+    garenteeValid(originalFile) {
       return new Promise((resolve) => {
         // 选中的图片以dataUrl形式存入FileReader,
         let fileReader = new FileReader()
@@ -258,7 +258,7 @@ export default {
         return globalApi.getPersonInImage(jpgFile)
       }).then((url) => {
         loadingHandler.close()
-        // 不能直接query.personImgUrl的值,会不生效。
+        // 不能直接query.personImgUrl的值,会不生效。
         this.$router.replace({
           name: this.$route.name,
           query: {
@@ -274,9 +274,9 @@ export default {
     },
     async getGroupPhotoDataUrl() {
       const canvas = await html2canvas(document.querySelector('.group-photo-wrapper'), {
-        useCORS: true, // 【重要】开启跨域配置
+        useCORS: true, // 尝试用CORS加载跨域图片
         scale: 1,
-        allowTaint: true, // 允许跨域图片
+        allowTaint: true, // 允许跨域图片taint canvas
         preserveDrawingBuffer: true,
       })
       this.aDownloadHref = canvas.toDataURL('image/jpeg', 1.0)