diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2006-04-27 06:12:22 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2006-04-27 06:12:22 +0000 |
| commit | b19f56578752c3134604791079e49d79762d7053 (patch) | |
| tree | 44ec888d394ebca994a02430299d88de3feed0fc /src/extension/internal/odf.cpp | |
| parent | expand the range of dpi to fix 1476741 (diff) | |
| download | inkscape-b19f56578752c3134604791079e49d79762d7053.tar.gz inkscape-b19f56578752c3134604791079e49d79762d7053.zip | |
Placemark for gradient export
(bzr r595)
Diffstat (limited to 'src/extension/internal/odf.cpp')
| -rw-r--r-- | src/extension/internal/odf.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index d950f4d1a..1487293bb 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -1081,11 +1081,17 @@ OdfOutput::preprocess(ZipFile &zf, Inkscape::XML::Node *node) { gi.style = "linear"; SPLinearGradient *linGrad = SP_LINEARGRADIENT(gradient); + gi.x1 = linGrad->x1.value; + gi.y1 = linGrad->y1.value; + gi.x2 = linGrad->x2.value; + gi.y2 = linGrad->y2.value; } else if (SP_IS_RADIALGRADIENT(gradient)) { gi.style = "radial"; SPRadialGradient *radGrad = SP_RADIALGRADIENT(gradient); + gi.cx = radGrad->cx.computed * 100.0;//ODG cx is percentages + gi.cy = radGrad->cy.computed * 100.0; } else { @@ -1347,7 +1353,19 @@ bool OdfOutput::writeStyle(Writer &outs) { GradientInfo gi(*giter); outs.printf("<draw:gradient draw:name=\"%s\" ", gi.name.c_str()); - outs.printf("draw:display-name=\"%s\"", gi.name.c_str()); + outs.printf("draw:display-name=\"%s\" ", gi.name.c_str()); + outs.printf("draw:style=\"%s\" ", gi.style.c_str()); + if (gi.style == "linear") + { + } + else if (gi.style == "gradient") + { + outs.printf("draw:cx=\".2f%%\" draw:cy=\".2f%%\" ", gi.cx, gi.cy); + } + else + { + g_warning("unsupported gradient style '%s'", gi.style.c_str()); + } outs.printf("/>\n"); } |
