Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 22978 → Rev 22977

/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
1755,35 → 1755,33
StitchingFunction *stitchingFunc = (StitchingFunction*)func;
const double *bounds = stitchingFunc->getBounds();
int num_funcs = stitchingFunc->getNumFuncs();
double domain_min = stitchingFunc->getDomainMin(0);
double domain_max = stitchingFunc->getDomainMax(0);
if (fabs(domain_max - domain_min) < 1e-6)
{
domain_min = 0.0;
domain_max = 1.0;
}
// Add stops from all the stitched functions
for (int i = 0 ; i <= num_funcs ; i++)
for ( int i = 0 ; i < num_funcs ; i++ )
{
GfxColor temp;
shading->getColor(bounds[i], &temp);
((GfxAxialShading*)shading)->getColor(bounds[i], &temp);
QString stopColor = getColor(color_space, &temp, &shade);
double stopPoint = (bounds[i] - domain_min) / (domain_max - domain_min);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i], 0.5, 1.0, stopColor, shade );
if (i == num_funcs - 1)
{
((GfxAxialShading*)shading)->getColor(bounds[i+1], &temp);
QString stopColor = getColor(color_space, &temp, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i+1], 0.5, 1.0, stopColor, shade );
}
}
}
else if ((func->getType() == 2) || (func->getType() == 0))
{
GfxColor stop1;
shading->getColor(0.0, &stop1);
((GfxAxialShading*)shading)->getColor(0.0, &stop1);
QString stopColor1 = getColor(color_space, &stop1, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
GfxColor stop2;
shading->getColor(1.0, &stop2);
((GfxAxialShading*)shading)->getColor(1.0, &stop2);
QString stopColor2 = getColor(color_space, &stop2, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
}
shading->getCoords(&GrStartX, &GrStartY, &GrEndX, &GrEndY);
((GfxAxialShading*)shading)->getCoords(&GrStartX, &GrStartY, &GrEndX, &GrEndY);
double xmin, ymin, xmax, ymax;
// get the clip region bbox
state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
1867,36 → 1865,34
StitchingFunction *stitchingFunc = (StitchingFunction*)func;
const double *bounds = stitchingFunc->getBounds();
int num_funcs = stitchingFunc->getNumFuncs();
double domain_min = stitchingFunc->getDomainMin(0);
double domain_max = stitchingFunc->getDomainMax(0);
if (fabs(domain_max - domain_min) < 1e-6)
{
domain_min = 0.0;
domain_max = 1.0;
}
// Add stops from all the stitched functions
for (int i = 0 ; i <= num_funcs ; i++)
for ( int i = 0 ; i < num_funcs ; i++ )
{
GfxColor temp;
shading->getColor(bounds[i], &temp);
((GfxRadialShading*)shading)->getColor(bounds[i], &temp);
QString stopColor = getColor(color_space, &temp, &shade);
double stopPoint = (bounds[i] - domain_min) / (domain_max - domain_min);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i], 0.5, 1.0, stopColor, shade );
if (i == num_funcs - 1)
{
((GfxRadialShading*)shading)->getColor(bounds[i+1], &temp);
QString stopColor = getColor(color_space, &temp, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), bounds[i+1], 0.5, 1.0, stopColor, shade );
}
}
}
else if ((func->getType() == 2) || (func->getType() == 0))
{
GfxColor stop1;
shading->getColor(0.0, &stop1);
((GfxRadialShading*)shading)->getColor(0.0, &stop1);
QString stopColor1 = getColor(color_space, &stop1, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
GfxColor stop2;
shading->getColor(1.0, &stop2);
((GfxRadialShading*)shading)->getColor(1.0, &stop2);
QString stopColor2 = getColor(color_space, &stop2, &shade);
FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
}
double r0, x1, y1, r1;
shading->getCoords(&GrStartX, &GrStartY, &r0, &x1, &y1, &r1);
((GfxRadialShading*)shading)->getCoords(&GrStartX, &GrStartY, &r0, &x1, &y1, &r1);
double xmin, ymin, xmax, ymax;
// get the clip region bbox
state->getClipBBox(&xmin, &ymin, &xmax, &ymax);