Explorar o código

添加角度限制

haojianlong %!s(int64=4) %!d(string=hai) anos
pai
achega
d8a39af46b
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/components/edit/right_toolbar.vue

+ 6 - 0
src/components/edit/right_toolbar.vue

@@ -175,6 +175,12 @@ export default {
         bus.$emit("itemPositon", x, y);
       } else if (item.name == 'Angle') {
         if (item.msg.length > 0 && !isNaN(Number(item.msg))) {
+          if (item.msg > 360) {
+            item.msg = 360
+          }
+          if (item.msg < -360) {
+            item.msg = -360
+          }
           bus.$emit('itemAngle', item.msg)
         }
       }