| 229 | */ |
| 230 | |
| 231 | function toRectangle( target ) { |
| 232 | |
| 233 | if ( target.nodeType && target.nodeType == 1 ) { |
| 234 | |
| 235 | var bounds = target.getBoundingClientRect(); |
| 236 | |
| 237 | target = { |
| 238 | height: target.offsetHeight, |
| 239 | width: target.offsetWidth, |
| 240 | x: bounds.left, |
| 241 | y: bounds.top |
| 242 | }; |
| 243 | } |
| 244 | |
| 245 | if ( !isNumber( target.x ) && isNumber( target.left ) ) |
| 246 | |
| 247 | target.x = target.left; |
| 248 | |
| 249 | if ( !isNumber( target.y ) && isNumber( target.top ) ) |
| 250 | |
| 251 | target.y = target.top; |
| 252 | |
| 253 | return target; |
| 254 | } |
| 255 | |
| 256 | /* |
| 257 | ———————————————————————————————————————————————————————————————————————————————— |