作図ソフト dia の改良版
修訂 | 63e66598aa7df29a657dfa16304330596b1386bf (tree) |
---|---|
時間 | 2009-10-06 05:08:10 |
作者 | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
Bug #591525 - fix opacitiy export of standard SVG renderer
Need to write fill-opacitiy and stroke-opacitiy as non localized double.
@@ -221,12 +221,15 @@ get_draw_style(DiaSvgRenderer *renderer, | ||
221 | 221 | { |
222 | 222 | static GString *str = NULL; |
223 | 223 | gchar linewidth_buf[DTOSTR_BUF_SIZE]; |
224 | + gchar alpha_buf[DTOSTR_BUF_SIZE]; | |
224 | 225 | |
225 | 226 | if (!str) str = g_string_new(NULL); |
226 | 227 | g_string_truncate(str, 0); |
227 | 228 | |
228 | 229 | /* TODO(CHECK): the shape-export didn't have 'fill: none' here */ |
229 | - g_string_printf(str, "fill: none; fill-opacity: %f; stroke-width: %s", colour->alpha, dia_svg_dtostr(linewidth_buf, renderer->linewidth) ); | |
230 | + g_string_printf(str, "fill: none; stroke-opacity: %s; stroke-width: %s", | |
231 | + g_ascii_formatd (alpha_buf, sizeof(alpha_buf), "%g", colour->alpha), | |
232 | + dia_svg_dtostr(linewidth_buf, renderer->linewidth) ); | |
230 | 233 | if (strcmp(renderer->linecap, "butt")) |
231 | 234 | g_string_append_printf(str, "; stroke-linecap: %s", renderer->linecap); |
232 | 235 | if (strcmp(renderer->linejoin, "miter")) |
@@ -248,12 +251,14 @@ get_fill_style(DiaSvgRenderer *renderer, | ||
248 | 251 | Color *colour) |
249 | 252 | { |
250 | 253 | static GString *str = NULL; |
254 | + gchar alpha_buf[DTOSTR_BUF_SIZE]; | |
251 | 255 | |
252 | 256 | if (!str) str = g_string_new(NULL); |
253 | 257 | |
254 | - g_string_printf(str, "fill: #%02x%02x%02x; fill-opacity: %f", | |
258 | + g_string_printf(str, "fill: #%02x%02x%02x; fill-opacity: %s", | |
255 | 259 | (int)ceil(255*colour->red), (int)ceil(255*colour->green), |
256 | - (int)ceil(255*colour->blue), colour->alpha); | |
260 | + (int)ceil(255*colour->blue), | |
261 | + g_ascii_formatd(alpha_buf, sizeof(alpha_buf), "%g", colour->alpha)); | |
257 | 262 | |
258 | 263 | return str->str; |
259 | 264 | } |