| 263 | } |
| 264 | |
| 265 | drawTargetObject(obj) { |
| 266 | // 创建目标锁定效果 |
| 267 | const target = document.createElement('div'); |
| 268 | target.className = 'target-lock'; |
| 269 | target.style.position = 'absolute'; |
| 270 | target.style.left = `${obj.x}px`; |
| 271 | target.style.top = `${obj.y}px`; |
| 272 | target.style.width = `${obj.width}px`; |
| 273 | target.style.height = `${obj.height}px`; |
| 274 | |
| 275 | // 添加锁定动画 |
| 276 | const svg = ` |
| 277 | <svg width="${obj.width}" height="${obj.height}" style="position: absolute; top: 0; left: 0;"> |
| 278 | <rect x="2" y="2" width="${obj.width-4}" height="${obj.height-4}" |
| 279 | class="target-lock" rx="8" ry="8"/> |
| 280 | </svg> |
| 281 | `; |
| 282 | target.innerHTML = svg; |
| 283 | |
| 284 | this.overlay.appendChild(target); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | // 初始化 |