• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

修訂63e66598aa7df29a657dfa16304330596b1386bf (tree)
時間2009-10-06 05:08:10
作者Hans Breuer <hans@breu...>
CommiterHans Breuer

Log Message

Bug #591525 - fix opacitiy export of standard SVG renderer

Need to write fill-opacitiy and stroke-opacitiy as non localized double.

Change Summary

差異

--- a/lib/diasvgrenderer.c
+++ b/lib/diasvgrenderer.c
@@ -221,12 +221,15 @@ get_draw_style(DiaSvgRenderer *renderer,
221221 {
222222 static GString *str = NULL;
223223 gchar linewidth_buf[DTOSTR_BUF_SIZE];
224+ gchar alpha_buf[DTOSTR_BUF_SIZE];
224225
225226 if (!str) str = g_string_new(NULL);
226227 g_string_truncate(str, 0);
227228
228229 /* 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) );
230233 if (strcmp(renderer->linecap, "butt"))
231234 g_string_append_printf(str, "; stroke-linecap: %s", renderer->linecap);
232235 if (strcmp(renderer->linejoin, "miter"))
@@ -248,12 +251,14 @@ get_fill_style(DiaSvgRenderer *renderer,
248251 Color *colour)
249252 {
250253 static GString *str = NULL;
254+ gchar alpha_buf[DTOSTR_BUF_SIZE];
251255
252256 if (!str) str = g_string_new(NULL);
253257
254- g_string_printf(str, "fill: #%02x%02x%02x; fill-opacity: %f",
258+ g_string_printf(str, "fill: #%02x%02x%02x; fill-opacity: %s",
255259 (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));
257262
258263 return str->str;
259264 }