| 1 |
function fitRect(rect,brect,pad) { |
| 2 |
var bw = Math.ceil(brect.width + pad + pad), |
| 3 |
bh = Math.ceil(brect.height + pad + pad); |
| 4 |
setattr(rect, 'x', (brect.x - pad) + 'px'); |
| 5 |
setattr(rect, 'y', (brect.y - pad) + 'px'); |
| 6 |
setattr(rect, 'width', bw + 'px'); |
| 7 |
setattr(rect, 'height', bh + 'px'); |
| 8 |
} |
| 9 |
|