Changeset 12673

Show
Ignore:
Timestamp:
02/23/08 22:29:50 (3 months ago)
Author:
elazutkin
Message:

Fixing radial gradient problem when starting from offset > 0.
Thx, Igor! Fixes #4604 !strict

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojox/trunk/gfx/vml.js

    r12663 r12673  
    7777                                                h = parseFloat(this.rawNode.style.height), 
    7878                                                c = isNaN(w) ? 1 : 2 * f.r / w; 
    79                                         a = new Array(f.colors.length); 
     79                                        a = []; 
     80                                        // add a color at the offset 0 (1 in VML coordinates) 
     81                                        if(f.colors[0].offset > 0){ 
     82                                                a.push({offset: 1, color: dojox.gfx.normalizeColor(f.colors[0].color)}); 
     83                                        } 
    8084                                        // massage colors 
    8185                                        dojo.forEach(f.colors, function(v, i){ 
    82                                                 a[i] = {offset: 1 - v.offset * c, color: dojox.gfx.normalizeColor(v.color)}; 
     86                                                a.push({offset: 1 - v.offset * c, color: dojox.gfx.normalizeColor(v.color)}); 
    8387                                        }); 
    8488                                        i = a.length - 1; 
     
    98102                                        for(; i >= 0; --i){ 
    99103                                                s.push(a[i].offset.toFixed(8) + " " + a[i].color.toHex()); 
    100                                         } 
    101                                         if(a[0].offset < 1){ 
    102                                                 s.push("1 " + a[0].color.toHex()); 
    103104                                        } 
    104105                                        fo = this.rawNode.fill;