| | 95 | |
|---|
| | 96 | // depending on the box model, modify width and height to take borders |
|---|
| | 97 | // of the box into account |
|---|
| | 98 | var dimensions = OpenLayers.Element.getDimensions(this.zoomBox); |
|---|
| | 99 | if (dimensions.width != deltaX || dimensions.height != deltaY) { |
|---|
| | 100 | var offsetX = parseInt(OpenLayers.Element.getStyle(this.zoomBox, |
|---|
| | 101 | "border-left-width")) + parseInt(OpenLayers.Element.getStyle( |
|---|
| | 102 | this.zoomBox, "border-right-width")); |
|---|
| | 103 | var offsetY = parseInt(OpenLayers.Element.getStyle(this.zoomBox, |
|---|
| | 104 | "border-top-width")) + parseInt(OpenLayers.Element.getStyle( |
|---|
| | 105 | this.zoomBox, "border-bottom-width")); |
|---|
| | 106 | this.zoomBox.style.width = Math.max(1, deltaX - offsetX) + "px"; |
|---|
| | 107 | this.zoomBox.style.height = Math.max(1, deltaY - offsetY) + "px"; |
|---|
| | 108 | } |
|---|