#i105655# commiting changes so far for preparing linux version
This commit is contained in:
parent
d31f876752
commit
bbe3fead69
1 changed files with 83 additions and 32 deletions
|
@ -1005,26 +1005,12 @@ namespace drawinglayer
|
|||
SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rStrokePrimitive.getB2DPolygon(), 0, &rStrokePrimitive.getLineAttribute(),
|
||||
&rStrokePrimitive.getStrokeAttribute(), 0, 0);
|
||||
|
||||
// Adapt OutDev's DrawMode if special ones were used
|
||||
const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode());
|
||||
adaptLineToFillDrawMode();
|
||||
|
||||
impStartSvtGraphicStroke(pSvtGraphicStroke);
|
||||
|
||||
// #i101491#
|
||||
// Change default of fat line generation for MetaFiles: Create MetaPolyLineAction
|
||||
// instead of decomposing all geometries when the polygon has more than given amount of
|
||||
// points; else the decomposition will get too expensive quiclky. OTOH
|
||||
// the decomposition provides the better quality e.g. taking edge roundings
|
||||
// into account which will NOT be taken into account with LineInfo-based actions
|
||||
const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count());
|
||||
bool bDone(0 == nSubPolygonCount);
|
||||
|
||||
if(!bDone && nSubPolygonCount > 1000)
|
||||
if(true)
|
||||
{
|
||||
// create MetaPolyLineActions, but without LINE_DASH
|
||||
impStartSvtGraphicStroke(pSvtGraphicStroke);
|
||||
const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute();
|
||||
|
||||
// create MetaPolyLineActions, but without LINE_DASH
|
||||
if(basegfx::fTools::more(rLine.getWidth(), 0.0))
|
||||
{
|
||||
const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute();
|
||||
|
@ -1044,10 +1030,9 @@ namespace drawinglayer
|
|||
const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor()));
|
||||
mpOutputDevice->SetLineColor(Color(aHairlineColor));
|
||||
mpOutputDevice->SetFillColor();
|
||||
|
||||
aHairLinePolyPolygon.transform(maCurrentTransformation);
|
||||
|
||||
const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
|
||||
LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
|
||||
aLineInfo.SetLineJoin(rLine.getLineJoin());
|
||||
|
||||
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
|
||||
{
|
||||
|
@ -1060,23 +1045,89 @@ namespace drawinglayer
|
|||
mrMetaFile.AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo));
|
||||
}
|
||||
}
|
||||
|
||||
bDone = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
process(rCandidate.get2DDecomposition(getViewInformation2D()));
|
||||
}
|
||||
|
||||
if(!bDone)
|
||||
impEndSvtGraphicStroke(pSvtGraphicStroke);
|
||||
}
|
||||
else
|
||||
{
|
||||
// use decomposition (creates line geometry as filled polygon
|
||||
// geometry)
|
||||
process(rCandidate.get2DDecomposition(getViewInformation2D()));
|
||||
// Adapt OutDev's DrawMode if special ones were used
|
||||
const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode());
|
||||
adaptLineToFillDrawMode();
|
||||
|
||||
impStartSvtGraphicStroke(pSvtGraphicStroke);
|
||||
|
||||
// #i101491#
|
||||
// Change default of fat line generation for MetaFiles: Create MetaPolyLineAction
|
||||
// instead of decomposing all geometries when the polygon has more than given amount of
|
||||
// points; else the decomposition will get too expensive quiclky. OTOH
|
||||
// the decomposition provides the better quality e.g. taking edge roundings
|
||||
// into account which will NOT be taken into account with LineInfo-based actions
|
||||
const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count());
|
||||
bool bDone(0 == nSubPolygonCount);
|
||||
|
||||
if(!bDone && nSubPolygonCount > 1000)
|
||||
{
|
||||
// create MetaPolyLineActions, but without LINE_DASH
|
||||
const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute();
|
||||
|
||||
if(basegfx::fTools::more(rLine.getWidth(), 0.0))
|
||||
{
|
||||
const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute();
|
||||
basegfx::B2DPolyPolygon aHairLinePolyPolygon;
|
||||
|
||||
if(0.0 == rStroke.getFullDotDashLen())
|
||||
{
|
||||
aHairLinePolyPolygon.append(rStrokePrimitive.getB2DPolygon());
|
||||
}
|
||||
else
|
||||
{
|
||||
basegfx::tools::applyLineDashing(
|
||||
rStrokePrimitive.getB2DPolygon(), rStroke.getDotDashArray(),
|
||||
&aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen());
|
||||
}
|
||||
|
||||
const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor()));
|
||||
mpOutputDevice->SetLineColor(Color(aHairlineColor));
|
||||
mpOutputDevice->SetFillColor();
|
||||
|
||||
aHairLinePolyPolygon.transform(maCurrentTransformation);
|
||||
|
||||
const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth()));
|
||||
|
||||
for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
|
||||
{
|
||||
const basegfx::B2DPolygon aCandidate(aHairLinePolyPolygon.getB2DPolygon(a));
|
||||
|
||||
if(aCandidate.count() > 1)
|
||||
{
|
||||
const Polygon aToolsPolygon(aCandidate);
|
||||
|
||||
mrMetaFile.AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo));
|
||||
}
|
||||
}
|
||||
|
||||
bDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!bDone)
|
||||
{
|
||||
// use decomposition (creates line geometry as filled polygon
|
||||
// geometry)
|
||||
process(rCandidate.get2DDecomposition(getViewInformation2D()));
|
||||
}
|
||||
|
||||
impEndSvtGraphicStroke(pSvtGraphicStroke);
|
||||
|
||||
// restore DrawMode
|
||||
mpOutputDevice->SetDrawMode(nOriginalDrawMode);
|
||||
}
|
||||
|
||||
impEndSvtGraphicStroke(pSvtGraphicStroke);
|
||||
|
||||
// restore DrawMode
|
||||
mpOutputDevice->SetDrawMode(nOriginalDrawMode);
|
||||
|
||||
break;
|
||||
}
|
||||
case PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D :
|
||||
|
|
Loading…
Reference in a new issue