Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 20646 → Rev 20647

/trunk/Scribus/scribus/pageitem_textframe.cpp
3708,7 → 3708,7
QColor tmp;
SetQColor(&tmp, LineStyle.backgroundColor(), LineStyle.backgroundShade());
double y0 = ls.y;
double y2 = 0;
double y2 = ls.y;
double ascent = ls.ascent;
double descent = ls.descent;
double rMarg = LineStyle.rightMargin();
3741,6 → 3741,8
llp++;
}
p->save();
p->setupPolygon(&PoLine);
p->setClipPath();
p->setAntialiasing(false);
p->setFillMode(1);
p->setStrokeMode(0);
3750,51 → 3752,6
p->restore();
}
}
/*
for (uint ll = 0; ll < textLayout.lines(); ++ll)
{
ls = textLayout.line(ll);
const ParagraphStyle& LineStyle = itemText.paragraphStyle(ls.firstItem);
// This code is for rendering paragraph background color.
// We just need to define this attribute for the paragraphs now.
if (LineStyle.backgroundColor() != CommonStrings::None)
{
p->save();
p->setAntialiasing(false);
p->setFillMode(1);
p->setStrokeMode(0);
QColor tmp;
SetQColor(&tmp, LineStyle.backgroundColor(), LineStyle.backgroundShade());
p->setBrush(tmp);
double y1 = ls.y;
double hl = ls.height;
double adjX = 0;
if (LineStyle.firstIndent() <= 0)
adjX += LineStyle.leftMargin() + LineStyle.firstIndent();
if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
hl = doc()->guidesPrefs().valueBaselineGrid;
else if (LineStyle.lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
hl = LineStyle.lineSpacing();
if (ls.isFirstLine)
{
if (textLayout.lines() == 1)
hl = ls.ascent + ls.descent;
if (LineStyle.hasDropCap())
hl *= LineStyle.dropCapLines();
}
if (LineStyle.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
y1 -= LineStyle.lineSpacing();
else if (firstLineOffset() == FLOPRealGlyphHeight || firstLineOffset() == FLOPFontAscent)
y1 -= ls.ascent;
else
y1 -= ls.ascent + (hl - (ls.ascent + ls.descent)) / 2.0;
p->drawRect(ls.colLeft + adjX, y1, columnWidth() - adjX - LineStyle.rightMargin(), hl);
p->setAntialiasing(true);
p->restore();
}
// end background code
}
*/
for (uint ll=0; ll < textLayout.lines(); ++ll)
{
ls = textLayout.line(ll);
/trunk/Scribus/scribus/pdflib_core.cpp
5390,7 → 5390,7
if (LineStyle.backgroundColor() != CommonStrings::None)
{
double y0 = ls.y;
double y2 = 0;
double y2 = ls.y;
double ascent = ls.ascent;
double descent = ls.descent;
double rMarg = LineStyle.rightMargin();
5425,6 → 5425,7
QRectF scr(lMarg + adjX, y0 - ascent, ite->asTextFrame()->columnWidth() - adjX - rMarg, y2 - y0 + descent + ascent);
tmp += "q\n";
tmp += "n\n";
tmp += SetPathAndClip(ite);
tmp += putColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), true);
tmp += FToStr(scr.x()) +" "+FToStr(-scr.y())+" m\n";
tmp += FToStr(scr.x() + scr.width())+" "+FToStr(-scr.y())+" l\n";
/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
1167,6 → 1167,27
ob.appendChild(ob1);
}
}
bool bFound = false;
for (uint ll=0; ll < Item->textLayout.lines(); ++ll)
{
if (Item->itemText.paragraphStyle(Item->textLayout.line(ll).firstItem).backgroundColor() != CommonStrings::None)
{
bFound = true;
break;
}
}
if (bFound)
{
QDomElement cl;
QDomElement ob2 = createClipPathElement(&Item->PoLine, &cl);
if (!ob2.isNull())
{
ob2.setAttribute("clipPathUnits", "userSpaceOnUse");
ob2.setAttribute("clip-rule", "evenodd");
}
if (!ob2.isNull())
ob.setAttribute("clip-path", "url(#" + ob2.attribute("id") + ")");
}
double x, y, wide;
QString chstr;
uint llp = 0;
/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
879,6 → 879,21
grp.appendChild(ob);
}
}
bool bFound = false;
for (uint ll=0; ll < Item->textLayout.lines(); ++ll)
{
if (Item->itemText.paragraphStyle(Item->textLayout.line(ll).firstItem).backgroundColor() != CommonStrings::None)
{
bFound = true;
break;
}
}
if (bFound)
{
FPointArray path = Item->PoLine.copy();
path.scale(conversionFactor, conversionFactor);
SetClipAttr(grp, &path, Item->fillRule);
}
uint llp = 0;
while (llp < Item->textLayout.lines())
{
887,7 → 902,7
if (LineStyle.backgroundColor() != CommonStrings::None)
{
double y0 = ls.y;
double y2 = 0;
double y2 = ls.y;
double ascent = ls.ascent;
double descent = ls.descent;
double rMarg = LineStyle.rightMargin();
/trunk/Scribus/scribus/pslib.cpp
5076,7 → 5076,7
if (LineStyle.backgroundColor() != CommonStrings::None)
{
double y0 = ls.y;
double y2 = 0;
double y2 = ls.y;
double ascent = ls.ascent;
double descent = ls.descent;
double rMarg = LineStyle.rightMargin();
5110,6 → 5110,7
}
QRectF scr(lMarg + adjX, y0 - ascent, ite->asTextFrame()->columnWidth() - adjX - rMarg, y2 - y0 + descent + ascent);
PS_save();
SetPathAndClip(ite->PoLine, true);
int h, s, v, k;
SetColor(LineStyle.backgroundColor(), LineStyle.backgroundShade(), &h, &s, &v, &k);
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);