allow for user to set the sizing method. make default 'scale'. set to 'crop' as desired for panzoombar in r396. removed outdated tests

git-svn-id: http://svn.openlayers.org/trunk/openlayers@401 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-26 15:47:07 +00:00
parent 7d81333da0
commit 542e9fa258
2 changed files with 8 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ OpenLayers.Control.PanZoomBar.prototype =
div = OpenLayers.Util.createAlphaImageDiv(id, centered,
new OpenLayers.Size(sz.w, zoomStopSize),
imgLocation + "zoombar.png",
"absolute");
"absolute", null, "crop");
div.style.height = sz.h;
} else {
div = OpenLayers.Util.createDiv(

View File

@@ -705,13 +705,14 @@ OpenLayers.Util.alphaHack = function() {
* @param {String} imgURL
* @param {String} position
* @param {String} border
* @param {String} sizing 'crop', 'scale', or 'image'. Default is "scale"
*
* @returns A DOM Div created with a DOM Image inside it. If the hack is
* needed for transparency in IE, it is added.
* @type DOMElement
*/
OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
position, border) {
position, border, sizing) {
var div = OpenLayers.Util.createDiv(id, px, sz);
var img = OpenLayers.Util.createImage(id + "_innerImage", null, sz,
@@ -720,8 +721,12 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
if (OpenLayers.Util.alphaHack()) {
div.style.display = "inline-block";
if (sizing == null) {
sizing = "scale";
}
div.style.filter = "progid:DXImageTransform.Microsoft" +
".AlphaImageLoader(src='" + imgURL + "', sizingMethod='crop')";
".AlphaImageLoader(src='" + imgURL + "', " +
"sizingMethod='" + sizing + "')";
img.style.filter = "progid:DXImageTransform.Microsoft" +
".Alpha(opacity=0)";
}