zhouenguang 3 年之前
父节点
当前提交
85e45b2323
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/JoyStick.js

+ 2 - 2
src/JoyStick.js

@@ -20,8 +20,8 @@ export default class JoyStick {
         a.style.position = "absolute",
         a.style.width = "200px",
         a.style.height = "200px",
-        a.style.left = String(n.left),
-        a.style.bottom = String(n.bottom),
+        a.style.left = String(n.left || 0),
+        a.style.bottom = String(n.bottom || 0),
         a.style.zIndex = "999",
         a.style.userSelect = "none",
         a.style.webkitUserSelect = "none",