Kaydet (Commit) 16fd7af9 authored tarafından Armin Le Grand's avatar Armin Le Grand

borderline: extended the expand logic

Extended and checked the expand logic for creating
the line extends. Now creating quite the right lines,
will need to check some speccial cases. Also some
cleanups.

Change-Id: I3a3bd4d23c7017ecd873147df2d93af61de39fa6
üst 1f02af4d
...@@ -165,89 +165,6 @@ namespace drawinglayer ...@@ -165,89 +165,6 @@ namespace drawinglayer
} }
} }
// static double fPatScFact(10.0); // 10.0 multiply, see old code
// const std::vector<double> aDashing(svtools::GetLineDashing(getStyle(), getPatternScale() * fPatScFact));
// const attribute::StrokeAttribute aStrokeAttribute(aDashing);
// if (3 == getBorderLines().size())
// {
// // double line with gap. Use mfSmallestAllowedDiscreteGapDistance (see get2DDecomposition) as distance.
// // That value is prepared to be at least one pixel (discrete unit) so that the
// // decomposition is view-dependent in this cases
// const BorderLine& rLeft(getBorderLines()[0]);
// const BorderLine& rGap(getBorderLines()[1]);
// const BorderLine& rRight(getBorderLines()[2]);
// const double fFullWidth(rLeft.getWidth() + mfSmallestAllowedDiscreteGapDistance + rRight.getWidth());
// {
// // inside line (left of vector). Create stroke primitive centered on left line width
// const double fDeltaY((rLeft.getWidth() - fFullWidth) * 0.5);
// const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY);
// const basegfx::B2DPoint aStart(getStart() - (aVector * rLeft.getBorderLineExtend().getStartAverage()) + aDeltaY);
// const basegfx::B2DPoint aEnd(getEnd() + (aVector * rLeft.getBorderLineExtend().getEndAverage()) + aDeltaY);
// const attribute::LineAttribute aLineAttribute(rLeft.getRGBColor(), rLeft.getWidth());
// addPolygonStrokePrimitive2D(
// rContainer,
// aStart,
// aEnd,
// aLineAttribute,
// aStrokeAttribute);
// }
// if (hasGapColor())
// {
// // gap (if visible, found practical usage in Writer MultiColorBorderLines).
// // Create stroke primitive on vector with given color centered on gap position
// const double fDeltaY(((fFullWidth - mfSmallestAllowedDiscreteGapDistance) * 0.5) - rRight.getWidth());
// const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY);
// const basegfx::B2DPoint aStart(getStart() - (aVector * rGap.getBorderLineExtend().getStartAverage()) + aDeltaY);
// const basegfx::B2DPoint aEnd(getEnd() + (aVector * rGap.getBorderLineExtend().getEndAverage()) + aDeltaY);
// const attribute::LineAttribute aLineAttribute(rGap.getRGBColor(), mfSmallestAllowedDiscreteGapDistance);
// addPolygonStrokePrimitive2D(
// rContainer,
// aStart,
// aEnd,
// aLineAttribute,
// aStrokeAttribute);
// }
// {
// // outside line (right of vector). Create stroke primitive centered on right line width
// const double fDeltaY((fFullWidth - rRight.getWidth()) * 0.5);
// const basegfx::B2DVector aDeltaY(aPerpendicular * fDeltaY);
// const basegfx::B2DPoint aStart(getStart() - (aVector * rRight.getBorderLineExtend().getStartAverage()) + aDeltaY);
// const basegfx::B2DPoint aEnd(getEnd() + (aVector * rRight.getBorderLineExtend().getEndAverage()) + aDeltaY);
// const attribute::LineAttribute aLineAttribute(rRight.getRGBColor(), rRight.getWidth());
// addPolygonStrokePrimitive2D(
// rContainer,
// aStart,
// aEnd,
// aLineAttribute,
// aStrokeAttribute);
// }
// }
// else
// {
// // single line, only inside values used, no vertical offsets
// const BorderLine& rBorderLine(getBorderLines()[0]);
// const attribute::LineAttribute aLineAttribute(rBorderLine.getRGBColor(), rBorderLine.getWidth());
// addPolygonStrokePrimitive2D(
// rContainer,
// getStart() - (aVector * rBorderLine.getBorderLineExtend().getStartAverage()),
// getEnd() + (aVector * rBorderLine.getBorderLineExtend().getEndAverage()),
// aLineAttribute,
// aStrokeAttribute);
// }
// }
// }
bool BorderLinePrimitive2D::isHorizontalOrVertical(const geometry::ViewInformation2D& rViewInformation) const bool BorderLinePrimitive2D::isHorizontalOrVertical(const geometry::ViewInformation2D& rViewInformation) const
{ {
if (!getStart().equal(getEnd())) if (!getStart().equal(getEnd()))
......
This diff is collapsed.
...@@ -988,7 +988,7 @@ void HelperCreateVerticalEntry( ...@@ -988,7 +988,7 @@ void HelperCreateVerticalEntry(
if(rStartFromBR.IsUsed()) aStart.push_back(StyleVectorCombination(rStartFromBR, rX + rY, false)); if(rStartFromBR.IsUsed()) aStart.push_back(StyleVectorCombination(rStartFromBR, rX + rY, false));
if(rStartTFromR.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromR, rX, false)); if(rStartTFromR.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromR, rX, false));
if(rStartTFromT.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromT, rY, true)); if(rStartTFromT.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromT, -rY, true));
if(rStartTFromL.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromL, -rX, true)); if(rStartTFromL.IsUsed()) aStart.push_back(StyleVectorCombination(rStartTFromL, -rX, true));
if(rStartFromBL.IsUsed()) aStart.push_back(StyleVectorCombination(rStartFromBL, rY - rX, true)); if(rStartFromBL.IsUsed()) aStart.push_back(StyleVectorCombination(rStartFromBL, rY - rX, true));
...@@ -1002,9 +1002,9 @@ void HelperCreateVerticalEntry( ...@@ -1002,9 +1002,9 @@ void HelperCreateVerticalEntry(
if(rEndFromTR.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndFromTR, rX - rY, false)); if(rEndFromTR.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndFromTR, rX - rY, false));
if(rEndBFromR.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromR, rX, false)); if(rEndBFromR.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromR, rX, false));
if(rEndBFromB.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromB, -rY, false)); if(rEndBFromB.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromB, rY, false));
if(rEndBFromL.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromL, rX, true)); if(rEndBFromL.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndBFromL, -rX, true));
if(rEndFromTL.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndFromTL, rX + rY, true)); if(rEndFromTL.IsUsed()) aEnd.push_back(StyleVectorCombination(rEndFromTL, -rX - rY, true));
CreateBorderPrimitives( CreateBorderPrimitives(
rSequence, rSequence,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment