diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-24 17:40:16 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-25 12:47:11 +0200 |
commit | df13da946f3d6571fc2975c6c4ec5592566c5d23 (patch) | |
tree | 07537cb9b20eb2b8706c40060825f241bdff259e /include | |
parent | e44c188a7353cc183fac8ece0cbf3611d842835e (diff) |
borderline: Refinement of line end overlaps
Change-Id: Ifb1a061ed39f92a13ad5c7b2daf103f3a48938a5
Reviewed-on: https://gerrit.libreoffice.org/42712
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Tested-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/framelink.hxx | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx index 771bc1e6dc7f..3e4b440fc886 100644 --- a/include/svx/framelink.hxx +++ b/include/svx/framelink.hxx @@ -232,35 +232,25 @@ private: double mfRefModeOffset; basegfx::B2DVector maB2DVector; + double mfAngle; std::vector< OffsetAndHalfWidthAndColor > maOffsets; public: StyleVectorCombination( const Style& rStyle, const basegfx::B2DVector& rB2DVector, + const double fAngle, bool bMirrored, const Color* pForceColor = nullptr); double getRefModeOffset() const { return mfRefModeOffset; } const basegfx::B2DVector& getB2DVector() const { return maB2DVector; } - + double getAngle() const { return mfAngle; } bool empty() const { return maOffsets.empty(); } size_t size() const { return maOffsets.size(); } + bool operator<( const StyleVectorCombination& rOther) const { return mfAngle < rOther.mfAngle; } - void getColorAndOffsetAndHalfWidth(size_t nIndex, Color& rColor, double& rfOffset, double& rfHalfWidth) const - { - if(nIndex >= maOffsets.size()) - return; - const OffsetAndHalfWidthAndColor& rCandidate(maOffsets[nIndex]); - rfOffset = rCandidate.mfOffset; - rfHalfWidth = rCandidate.mfHalfWidth; - rColor = rCandidate.maColor; - } - - bool operator<(const StyleVectorCombination& rOther) const - { - return getB2DVector().cross(rOther.getB2DVector()) < 0.0; - } + void getColorAndOffsetAndHalfWidth(size_t nIndex, Color& rColor, double& rfOffset, double& rfHalfWidth) const; }; class SAL_WARN_UNUSED SVX_DLLPUBLIC StyleVectorTable @@ -278,18 +268,9 @@ public: const Style& rStyle, const basegfx::B2DVector& rMyVector, const basegfx::B2DVector& rOtherVector, - bool bMirrored) - { - if(rStyle.IsUsed() && !basegfx::areParallel(rMyVector, rOtherVector)) - { - maEntries.emplace_back(rStyle, rOtherVector, bMirrored); - } - } + bool bMirrored); - void sort() - { - std::sort(maEntries.begin(), maEntries.end()); - } + void sort(); bool empty() const { return maEntries.empty(); } size_t size() const { return maEntries.size(); } |