| 1127 | } |
| 1128 | |
| 1129 | function getPointClientRect(point: EventPoint): Rect { |
| 1130 | let offsetX = 0; |
| 1131 | let offsetY = 0; |
| 1132 | if (point.width !== undefined) { |
| 1133 | offsetX = point.width / 2; |
| 1134 | } else if (point.radiusX !== undefined) { |
| 1135 | offsetX = point.radiusX; |
| 1136 | } |
| 1137 | if (point.height !== undefined) { |
| 1138 | offsetY = point.height / 2; |
| 1139 | } else if (point.radiusY !== undefined) { |
| 1140 | offsetY = point.radiusY; |
| 1141 | } |
| 1142 | |
| 1143 | return { |
| 1144 | top: point.clientY - offsetY, |
| 1145 | right: point.clientX + offsetX, |
| 1146 | bottom: point.clientY + offsetY, |
| 1147 | left: point.clientX - offsetX |
| 1148 | }; |
| 1149 | } |
| 1150 | |
| 1151 | function areRectanglesOverlapping(a: Rect, b: Rect) { |
| 1152 | // check if they cannot overlap on x axis |