| | 102 | |
|---|
| | 103 | // depending on the box model, modify width and height to take borders |
|---|
| | 104 | // of the box into account |
|---|
| | 105 | var box = this.getBoxCharacteristics(deltaX, deltaY); |
|---|
| | 106 | if (box.newBoxModel) { |
|---|
| | 107 | if (xy.x > startX) { |
|---|
| | 108 | this.zoomBox.style.width = |
|---|
| | 109 | Math.max(1, deltaX - box.xOffset) + "px"; |
|---|
| | 110 | } |
|---|
| | 111 | if (xy.y > startY) { |
|---|
| | 112 | this.zoomBox.style.height = |
|---|
| | 113 | Math.max(1, deltaY - box.yOffset) + "px"; |
|---|
| | 114 | } |
|---|
| | 115 | } |
|---|
| | 175 | |
|---|
| | 176 | getBoxCharacteristics: function(dx, dy) { |
|---|
| | 177 | if (!this.boxCharacteristics) { |
|---|
| | 178 | var xOffset = parseInt(OpenLayers.Element.getStyle(this.zoomBox, |
|---|
| | 179 | "border-left-width")) + parseInt(OpenLayers.Element.getStyle( |
|---|
| | 180 | this.zoomBox, "border-right-width")) + 1; |
|---|
| | 181 | var yOffset = parseInt(OpenLayers.Element.getStyle(this.zoomBox, |
|---|
| | 182 | "border-top-width")) + parseInt(OpenLayers.Element.getStyle( |
|---|
| | 183 | this.zoomBox, "border-bottom-width")) + 1; |
|---|
| | 184 | var dims = OpenLayers.Element.getDimensions(this.zoomBox); |
|---|
| | 185 | var newBoxModel = OpenLayers.Util.getBrowserName() == "msie" ? |
|---|
| | 186 | document.compatMode != "BackCompat" : true; |
|---|
| | 187 | this.boxCharacteristics = { |
|---|
| | 188 | xOffset: xOffset, |
|---|
| | 189 | yOffset: yOffset, |
|---|
| | 190 | newBoxModel: newBoxModel |
|---|
| | 191 | } |
|---|
| | 192 | } |
|---|
| | 193 | return this.boxCharacteristics; |
|---|
| | 194 | }, |
|---|