diff options
author | Armin Le Grand <alg@apache.org> | 2013-08-30 11:35:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-30 14:21:36 +0100 |
commit | 5dce602d31bfc3ab57653b5922459fec46a1e1be (patch) | |
tree | 475d61ead6b18c031a976520952876f0fb65c196 /sw | |
parent | fe1cbda3b7513e0d3686d347aa991e7231067384 (diff) |
Resolves: #i123129# Corrected LineWidth for text comments in SW
(cherry picked from commit 7ed3f859004e0763598a7d6edc7e4dec2b69813c)
Change-Id: Ife132b66a13208193d897e98cdaea17bce33c310
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/docvw/AnchorOverlayObject.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx index 1cd43528118b..5ea13c2cfe93 100644 --- a/sw/source/ui/docvw/AnchorOverlayObject.cxx +++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx @@ -45,7 +45,7 @@ private: basegfx::BColor maColor; // discrete line width - double mfLogicLineWidth; + double mfDiscreteLineWidth; // bitfield bool mbShadow : 1; @@ -61,7 +61,7 @@ public: const basegfx::B2DPolygon& rLineTop, AnchorState aAnchorState, const basegfx::BColor& rColor, - double fLogicLineWidth, + double fDiscreteLineWidth, bool bShadow, bool bLineSolid ) : drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D(), @@ -70,7 +70,7 @@ public: maLineTop(rLineTop), maAnchorState(aAnchorState), maColor(rColor), - mfLogicLineWidth(fLogicLineWidth), + mfDiscreteLineWidth(fDiscreteLineWidth), mbShadow(bShadow), mbLineSolid(bLineSolid) {} @@ -81,7 +81,7 @@ public: const basegfx::B2DPolygon& getLineTop() const { return maLineTop; } AnchorState getAnchorState() const { return maAnchorState; } const basegfx::BColor& getColor() const { return maColor; } - double getLogicLineWidth() const { return mfLogicLineWidth; } + double getDiscreteLineWidth() const { return mfDiscreteLineWidth; } bool getShadow() const { return mbShadow; } bool getLineSolid() const { return mbLineSolid; } @@ -108,14 +108,15 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aTriangle); } + // prepare view-independent LineWidth and color + const drawinglayer::attribute::LineAttribute aLineAttribute( + getColor(), + getDiscreteLineWidth() * getDiscreteUnit()); + if ( AS_ALL == maAnchorState || AS_START == maAnchorState ) { // create line start - const drawinglayer::attribute::LineAttribute aLineAttribute( - getColor(), - getLogicLineWidth() / (basegfx::fTools::equalZero(getDiscreteUnit()) ? 1.0 : getDiscreteUnit())); - if(getLineSolid()) { const drawinglayer::primitive2d::Primitive2DReference aSolidLine( @@ -194,10 +195,6 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos { // LineTop has to be created, too, but uses no shadow, so add after // the other parts are created - const drawinglayer::attribute::LineAttribute aLineAttribute( - getColor(), - getLogicLineWidth() / (basegfx::fTools::equalZero(getDiscreteUnit()) ? 1.0 : getDiscreteUnit())); - const drawinglayer::primitive2d::Primitive2DReference aLineTop( new drawinglayer::primitive2d::PolygonStrokePrimitive2D( getLineTop(), @@ -220,7 +217,7 @@ bool AnchorPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive && getLineTop() == rCompare.getLineTop() && getAnchorState() == rCompare.getAnchorState() && getColor() == rCompare.getColor() - && getLogicLineWidth() == rCompare.getLogicLineWidth() + && getDiscreteLineWidth() == rCompare.getDiscreteLineWidth() && getShadow() == rCompare.getShadow() && getLineSolid() == rCompare.getLineSolid()); } @@ -346,13 +343,14 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorOverlayObject::createOverla { implEnsureGeometry(); + static double aDiscreteLineWidth(1.6); const drawinglayer::primitive2d::Primitive2DReference aReference( new AnchorPrimitive( maTriangle, maLine, maLineTop, GetAnchorState(), getBaseColor().getBColor(), - ANCHORLINE_WIDTH * 15.0, + ANCHORLINE_WIDTH * aDiscreteLineWidth, getShadowedEffect(), getLineSolid()) ); |