diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-06-27 04:22:32 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-06-27 04:22:32 +0000 |
| commit | d3d59fa1e949280a70028f5161266e08ae751de4 (patch) | |
| tree | 056fa4972a80122b7c1152ca5e435fb8d0099894 /src | |
| parent | a little optimization by making some macros into inlined functions (diff) | |
| download | inkscape-d3d59fa1e949280a70028f5161266e08ae751de4.tar.gz inkscape-d3d59fa1e949280a70028f5161266e08ae751de4.zip | |
move ensure_vector to correct place so that gradients with transparency can be exported from commandline
(bzr r1303)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/pdf.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/extension/internal/pdf.cpp b/src/extension/internal/pdf.cpp index 938f570b7..c85be3b56 100644 --- a/src/extension/internal/pdf.cpp +++ b/src/extension/internal/pdf.cpp @@ -533,6 +533,9 @@ PrintPDF::print_fill_alpha(SVGOStringStream &/*os*/, SPStyle const *const style, if (SP_IS_LINEARGRADIENT (SP_STYLE_FILL_SERVER (style))) {
SPLinearGradient *lg=SP_LINEARGRADIENT(SP_STYLE_FILL_SERVER (style));
+
+ sp_gradient_ensure_vector(SP_GRADIENT(lg)); // when exporting from commandline, vector is not built
+
NR::Point p1 (lg->x1.computed, lg->y1.computed);
NR::Point p2 (lg->x2.computed, lg->y2.computed);
if (pbox && SP_GRADIENT(lg)->units == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
@@ -571,7 +574,6 @@ PrintPDF::print_fill_alpha(SVGOStringStream &/*os*/, SPStyle const *const style, *pdf_alpha << "/Domain [0 1]\n";
*pdf_alpha << "/Function <<\n/FunctionType 3\n/Functions\n[\n";
- sp_gradient_ensure_vector(SP_GRADIENT(lg)); // when exporting from commandline, vector is not built
for (gint i = 0; unsigned(i) < lg->vector.stops.size() - 1; i++) {
*pdf_alpha << "<<\n/FunctionType 2\n/Domain [0 1]\n";
*pdf_alpha << "/C0 [" << lg->vector.stops[i].opacity << "]\n";
@@ -658,6 +660,9 @@ PrintPDF::print_fill_alpha(SVGOStringStream &/*os*/, SPStyle const *const style, } else if (SP_IS_RADIALGRADIENT (SP_STYLE_FILL_SERVER (style))) {
SPRadialGradient *rg=SP_RADIALGRADIENT(SP_STYLE_FILL_SERVER (style));
+
+ sp_gradient_ensure_vector(SP_GRADIENT(rg)); // when exporting from commandline, vector is not built
+
NR::Point c (rg->cx.computed, rg->cy.computed);
NR::Point f (rg->fx.computed, rg->fy.computed);
double r = rg->r.computed;
@@ -698,7 +703,6 @@ PrintPDF::print_fill_alpha(SVGOStringStream &/*os*/, SPStyle const *const style, *pdf_alpha << "/Domain [0 1]\n";
*pdf_alpha << "/Function <<\n/FunctionType 3\n/Functions\n[\n";
- sp_gradient_ensure_vector(SP_GRADIENT(rg)); // when exporting from commandline, vector is not built
for (gint i = 0; unsigned(i) < rg->vector.stops.size() - 1; i++) {
*pdf_alpha << "<<\n/FunctionType 2\n/Domain [0 1]\n";
*pdf_alpha << "/C0 [" << rg->vector.stops[i].opacity << "]\n";
|
