(event: MouseEvent)
| 123 | |
| 124 | @HostListener('document:mousemove', ['$event']) |
| 125 | onMouseMove(event: MouseEvent) { |
| 126 | // Handle resizing first |
| 127 | if (this.isResizing && !this.windowState.isMaximized) { |
| 128 | this.handleResize(event); |
| 129 | return; |
| 130 | } |
| 131 | |
| 132 | // Handle dragging |
| 133 | if (this.isDragging && !this.windowState.isMaximized) { |
| 134 | const deltaX = event.clientX - this.dragStartX; |
| 135 | const deltaY = event.clientY - this.dragStartY; |
| 136 | |
| 137 | // Convert pixel deltas to percentage |
| 138 | const windowWidth = window.innerWidth; |
| 139 | const windowHeight = window.innerHeight; |
| 140 | |
| 141 | const deltaXPercent = (deltaX / windowWidth) * 100; |
| 142 | const deltaYPercent = (deltaY / windowHeight) * 100; |
| 143 | |
| 144 | let newX = this.dragStartWindowX + deltaXPercent; |
| 145 | let newY = this.dragStartWindowY + deltaYPercent; |
| 146 | |
| 147 | // Keep window within bounds |
| 148 | newX = Math.max(0, Math.min(newX, 100 - this.windowState.width)); |
| 149 | newY = Math.max(0, Math.min(newY, 100 - this.windowState.height)); |
| 150 | |
| 151 | this.windowManager.updateWindowPosition(this.windowState.id, newX, newY); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | @HostListener('document:mouseup', ['$event']) |
| 156 | onMouseUp(event: MouseEvent) { |
nothing calls this directly
no test coverage detected