comparison nodejs/svg.js @ 881:a17c4e231e54 abs_n_rel_center

Transform positions of radient paints. cx, cy of radial and x1, y1, x2, y2 of linear gradient paints must be transformed with aggregated matrix of painted shapes. Pattern to user space transformation maybe used to get more precise color.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 25 Sep 2010 20:12:45 +0800
parents ac3e8492ad74
children d9d55bb50679
comparison
equal deleted inserted replaced
880:ac3e8492ad74 881:a17c4e231e54
1098 x2 = hrefgr[2]; 1098 x2 = hrefgr[2];
1099 if(typeof y2 == "undefined") 1099 if(typeof y2 == "undefined")
1100 y2 = hrefgr[3]; 1100 y2 = hrefgr[3];
1101 } 1101 }
1102 1102
1103 if(n.attr('gradientTransform')) { 1103 if(n.attr("gradientTransform")) {
1104 parseTransform(mtx, n.attr('gradientTransform').value()); 1104 parseTransform(mtx, n.attr("gradientTransform").value());
1105 xy = _pnt_transform(x1, y1, mtx); 1105 xy = _pnt_transform(x1, y1, mtx);
1106 x1 = xy[0]; 1106 x1 = xy[0];
1107 y1 = xy[1]; 1107 y1 = xy[1];
1108 xy = _pnt_transform(x2, y2, mtx); 1108 xy = _pnt_transform(x2, y2, mtx);
1109 x2 = xy[0]; 1109 x2 = xy[0];
1148 if(href) { 1148 if(href) {
1149 href = href.value().substring(1); 1149 href = href.value().substring(1);
1150 stops = this.stop_ref[href]; 1150 stops = this.stop_ref[href];
1151 } 1151 }
1152 1152
1153 if(n.attr('gradientTransform')) { 1153 if(n.attr("gradientTransform")) {
1154 parseTransform(mtx, n.attr('gradientTransform').value()); 1154 parseTransform(mtx, n.attr("gradientTransform").value());
1155 xy = _pnt_transform(cx, cy, mtx); 1155 xy = _pnt_transform(cx, cy, mtx);
1156 sys.puts(mtx);
1157 sys.puts(xy);
1158 sys.puts([cx, cy]);
1156 cx = xy[0]; 1159 cx = xy[0];
1157 cy = xy[1]; 1160 cy = xy[1];
1158 } 1161 }
1159 1162
1160 this.radials[id] = [cx, cy, r]; 1163 this.radials[id] = [cx, cy, r];