rem: var w = width, dx = 0; var dy = r-y; dy = Math.max(r-y, y-(height-r)); 
add: var h = Math.floor((i+1)*height/bars) - y; var dx = 0; var dy = Math.max(r-y, y-(height-r)); 
context: OSGradient.addGradient = function(e, properties) {    e.style.position = 'relative';    var c0 = properties['gradient-start-color'];    if (c0 == undefined) c0 = 0x000000;    var c1 = properties['gradient-end-color'];    if (c1 == undefined) c1 = 0xffffff;    var r = properties['border-radius'] || 0;    var width = e.offsetWidth, height = e.offsetHeight;    var spans = [];    var bars = 256;    for (var i = 0; i < bars; i++) {        var color = OSUtils.color.interpolate(c0, c1, i/bars);        var h = Math.floor((i+1)*height/bars) - Math.floor(i*height/bars);        var y = Math.floor(i*height/bars);        var w = width, dx = 0;        var dy = r-y;        dy = Math.max(r-y, y-(height-r));        if (0 <= dy) dx = r - Math.sqrt(r*r-dy*dy);        var properties = {position: 'relative',                          width: w-2*dx,                          height: h,                          left: dx,                          background: OSUtils.color.long2css(color)};        var style = [];        for (var p in properties) {            style.push(p + ':' + properties[p]);        }        spans.push('<div style="'+style.join(';')+'"></div>');        //info(dy, dx, properties);        //break;    }    var g = document.createElement('div');    g.style.position = 'absolute';    g.style.left='0px';    g.style.top='0px';    g.style.width="100%";    g.style.height='100%';    //g.style['z-index'] = '-1';    g.style.zIndex = -1;    if (e.childNodes.length)        e.insertBefore(g, e.childNodes[0]);    else        e.appendChild(g);    g.innerHTML = spans.join('');};
meta: 5392	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5392/dce6ca2cd075da8de8464bdee4f243c2fee54adb/gradients.js/buggy/sources/javascript/gradients.js