EMF+: actually use lineJoin attribute for polygons.
Change-Id: I5b369703333332598353d9817f0253bbe5fc3601
This commit is contained in:
parent
2b3b4d4085
commit
9b1ceabd5f
@ -623,6 +623,19 @@ namespace cppcanvas
|
|||||||
return rendering::PathCapType::BUTT;
|
return rendering::PathCapType::BUTT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sal_Int8 lcl_convertLineJoinType(sal_uInt32 nEmfLineJoin)
|
||||||
|
{
|
||||||
|
switch (nEmfLineJoin)
|
||||||
|
{
|
||||||
|
case EmfPlusLineJoinTypeMiter: // fall-through
|
||||||
|
case EmfPlusLineJoinTypeMiterClipped: return rendering::PathJoinType::MITER;
|
||||||
|
case EmfPlusLineJoinTypeBevel: return rendering::PathJoinType::BEVEL;
|
||||||
|
case EmfPlusLineJoinTypeRound: return rendering::PathJoinType::ROUND;
|
||||||
|
}
|
||||||
|
assert(false); // Line Join type isn't in specification.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct EMFPCustomLineCap : public EMFPObject
|
struct EMFPCustomLineCap : public EMFPObject
|
||||||
{
|
{
|
||||||
sal_uInt32 type;
|
sal_uInt32 type;
|
||||||
@ -644,14 +657,7 @@ namespace cppcanvas
|
|||||||
{
|
{
|
||||||
aAttributes.StartCapType = lcl_convertStrokeCap(strokeStartCap);
|
aAttributes.StartCapType = lcl_convertStrokeCap(strokeStartCap);
|
||||||
aAttributes.EndCapType = lcl_convertStrokeCap(strokeEndCap);
|
aAttributes.EndCapType = lcl_convertStrokeCap(strokeEndCap);
|
||||||
|
aAttributes.JoinType = lcl_convertLineJoinType(strokeJoin);
|
||||||
switch (strokeJoin)
|
|
||||||
{
|
|
||||||
case EmfPlusLineJoinTypeMiter: // fall-through
|
|
||||||
case EmfPlusLineJoinTypeMiterClipped: aAttributes.JoinType = rendering::PathJoinType::MITER; break;
|
|
||||||
case EmfPlusLineJoinTypeBevel: aAttributes.JoinType = rendering::PathJoinType::BEVEL; break;
|
|
||||||
case EmfPlusLineJoinTypeRound: aAttributes.JoinType = rendering::PathJoinType::ROUND; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
aAttributes.MiterLimit = miterLimit;
|
aAttributes.MiterLimit = miterLimit;
|
||||||
}
|
}
|
||||||
@ -789,8 +795,10 @@ namespace cppcanvas
|
|||||||
rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getLength());
|
rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStrokeDashing(rendering::StrokeAttributes& rStrokeAttributes)
|
void SetStrokeAttributes(rendering::StrokeAttributes& rStrokeAttributes)
|
||||||
{
|
{
|
||||||
|
rStrokeAttributes.JoinType = lcl_convertLineJoinType(lineJoin);
|
||||||
|
|
||||||
if (dashStyle != EmfPlusLineStyleSolid)
|
if (dashStyle != EmfPlusLineStyleSolid)
|
||||||
{
|
{
|
||||||
const float dash[] = {3, 3};
|
const float dash[] = {3, 3};
|
||||||
@ -1395,7 +1403,7 @@ namespace cppcanvas
|
|||||||
// but eg. dashing has to be additionally set only on the
|
// but eg. dashing has to be additionally set only on the
|
||||||
// polygon
|
// polygon
|
||||||
rendering::StrokeAttributes aPolygonAttributes(aCommonAttributes);
|
rendering::StrokeAttributes aPolygonAttributes(aCommonAttributes);
|
||||||
pen->SetStrokeDashing(aPolygonAttributes);
|
pen->SetStrokeAttributes(aPolygonAttributes);
|
||||||
|
|
||||||
basegfx::B2DPolyPolygon aFinalPolyPolygon;
|
basegfx::B2DPolyPolygon aFinalPolyPolygon;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user