var attractSwitch = true;//自动吸附开关,true 为开启,否则关闭 //矩形物体类别枚举 var T_PDU = 'PDU'; var T_AC = 'AC'; var T_CABINET = 'CABINET'; var T_FLOOR = 'FLOOR'; var magicalLength = 10;//矩形物体边缘的垂直距离小于等于此长度则自动吸附 var rectsPdu = new ArrayList(); var rectsAC = new ArrayList(); var rectsCabinet = new ArrayList(); var rectsFloor = new ArrayList(); /** * 吸附 */ function attract(moveObj) { if (!attractSwitch) { return null; } var findAttractObj = false; var currentXOffset = 10000; var currentYOffset = 10000; for (var i = 0;
svg中自动吸附靠近的物体
最新推荐文章于 2023-02-02 16:51:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)