From 43b14f7341b8f103cb9da0cf47be9d2faffe1246 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Tue, 27 Jun 2006 04:22:32 +0000 Subject: [PATCH] move ensure_vector to correct place so that gradients with transparency can be exported from commandline --- src/extension/internal/pdf.cpp | 8 ++++++-- 1 file 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"; -- 2.30.2