Add an icon_size parameter to ag_chart_create_svg()

This commit is contained in:
Gergely Polonkai 2014-09-28 00:38:20 +02:00
parent c89f701e04
commit a02c584d7d
3 changed files with 9 additions and 6 deletions

View File

@ -1457,6 +1457,7 @@ ag_chart_create_svg(AgChart *chart,
gboolean rendering, gboolean rendering,
AgDisplayTheme *theme, AgDisplayTheme *theme,
guint image_size, guint image_size,
guint icon_size,
GError **err) GError **err)
{ {
xmlDocPtr doc = create_save_doc(chart), xmlDocPtr doc = create_save_doc(chart),
@ -1803,16 +1804,17 @@ ag_chart_create_svg(AgChart *chart,
g_free(css); g_free(css);
params[4] = "chart-size"; params[4] = "chart-size";
params[6] = "image-size"; params[6] = "image-size";
params[8] = "icon-size";
if (image_size == 0) { if (image_size == 0) {
params[5] = g_strdup_printf("%d", AG_CHART_DEFAULT_RING_SIZE); params[5] = g_strdup_printf("%d", AG_CHART_DEFAULT_RING_SIZE);
params[7] = g_strdup("0"); params[7] = g_strdup("0");
params[9] = g_strdup("0");
} else { } else {
params[5] = g_strdup("0"); params[5] = g_strdup("0");
params[7] = g_strdup_printf("%d", image_size); params[7] = g_strdup_printf("%d", image_size);
params[9] = g_strdup_printf("%d", icon_size);
} }
params[8] = "icon-size";
params[9] = g_strdup_printf("%d", AG_CHART_DEFAULT_ICON_SIZE);
// libxml2 messes up the output, as it prints decimal floating point // libxml2 messes up the output, as it prints decimal floating point
// numbers in a localized format. It is not good in locales that use a // numbers in a localized format. It is not good in locales that use a
@ -1871,7 +1873,7 @@ ag_chart_export_svg_to_file(AgChart *chart,
&length, &length,
TRUE, TRUE,
theme, theme,
0, 0, 0,
err err
)) == NULL) { )) == NULL) {
return; return;
@ -1908,7 +1910,7 @@ ag_chart_export_jpg_to_file(AgChart *chart,
&svg_length, &svg_length,
TRUE, TRUE,
theme, theme,
0, 0, 0,
err err
)) == NULL) { )) == NULL) {
return; return;

View File

@ -129,6 +129,7 @@ gchar *ag_chart_create_svg(AgChart *chart,
gboolean rendering, gboolean rendering,
AgDisplayTheme *theme, AgDisplayTheme *theme,
guint image_size, guint image_size,
guint icon_size,
GError **err); GError **err);
GList *ag_chart_get_planets(AgChart *chart); GList *ag_chart_get_planets(AgChart *chart);

View File

@ -532,7 +532,7 @@ ag_window_redraw_chart(AgWindow *window)
&length, &length,
FALSE, FALSE,
NULL, NULL,
0, 0, 0,
&err &err
); );