Mercurial > MadButterfly
comparison nodejs/svg.js @ 710:c93381320d6e
Fill shapes with black if with out any stroke and fill in the style
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 13 Aug 2010 18:23:44 +0800 |
parents | 920c9e6e4214 |
children | 54618e0cd36b |
comparison
equal
deleted
inserted
replaced
709:920c9e6e4214 | 710:c93381320d6e |
---|---|
139 var style = n.attr('style'); | 139 var style = n.attr('style'); |
140 var path = mb_rt.path_new(d); | 140 var path = mb_rt.path_new(d); |
141 var paint; | 141 var paint; |
142 | 142 |
143 if (style==null) { | 143 if (style==null) { |
144 paint = mb_rt.paint_color_new(0,0,0,0.1); | 144 paint = mb_rt.paint_color_new(0,0,0,1); |
145 paint.stroke(path); | 145 paint.stroke(path); |
146 } else { | 146 } else { |
147 var items = style.value().split(';'); | 147 var items = style.value().split(';'); |
148 var fill_alpha = 1; | 148 var fill_alpha = 1; |
149 var stroke_alpha = 1; | 149 var stroke_alpha = 1; |
177 } | 177 } |
178 if(stroke_color) { | 178 if(stroke_color) { |
179 paint = _prepare_paint_color(stroke_color, stroke_alpha); | 179 paint = _prepare_paint_color(stroke_color, stroke_alpha); |
180 paint.stroke(path); | 180 paint.stroke(path); |
181 } | 181 } |
182 if(!stroke_color && !fill_color) { | |
183 paint = mb_rt.paint_color_new(0, 0, 0, 1); | |
184 paint.fill(path); | |
185 } | |
182 | 186 |
183 } | 187 } |
184 coord.add_shape(path); | 188 coord.add_shape(path); |
185 } | 189 } |
186 | 190 |