Kaydet (Commit) 5dce602d authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Resolves: #i123129# Corrected LineWidth for text comments in SW

(cherry picked from commit 7ed3f859)

Change-Id: Ife132b66a13208193d897e98cdaea17bce33c310
üst fe1cbda3
...@@ -45,7 +45,7 @@ private: ...@@ -45,7 +45,7 @@ private:
basegfx::BColor maColor; basegfx::BColor maColor;
// discrete line width // discrete line width
double mfLogicLineWidth; double mfDiscreteLineWidth;
// bitfield // bitfield
bool mbShadow : 1; bool mbShadow : 1;
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
const basegfx::B2DPolygon& rLineTop, const basegfx::B2DPolygon& rLineTop,
AnchorState aAnchorState, AnchorState aAnchorState,
const basegfx::BColor& rColor, const basegfx::BColor& rColor,
double fLogicLineWidth, double fDiscreteLineWidth,
bool bShadow, bool bShadow,
bool bLineSolid ) bool bLineSolid )
: drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D(), : drawinglayer::primitive2d::DiscreteMetricDependentPrimitive2D(),
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
maLineTop(rLineTop), maLineTop(rLineTop),
maAnchorState(aAnchorState), maAnchorState(aAnchorState),
maColor(rColor), maColor(rColor),
mfLogicLineWidth(fLogicLineWidth), mfDiscreteLineWidth(fDiscreteLineWidth),
mbShadow(bShadow), mbShadow(bShadow),
mbLineSolid(bLineSolid) mbLineSolid(bLineSolid)
{} {}
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
const basegfx::B2DPolygon& getLineTop() const { return maLineTop; } const basegfx::B2DPolygon& getLineTop() const { return maLineTop; }
AnchorState getAnchorState() const { return maAnchorState; } AnchorState getAnchorState() const { return maAnchorState; }
const basegfx::BColor& getColor() const { return maColor; } const basegfx::BColor& getColor() const { return maColor; }
double getLogicLineWidth() const { return mfLogicLineWidth; } double getDiscreteLineWidth() const { return mfDiscreteLineWidth; }
bool getShadow() const { return mbShadow; } bool getShadow() const { return mbShadow; }
bool getLineSolid() const { return mbLineSolid; } bool getLineSolid() const { return mbLineSolid; }
...@@ -108,14 +108,15 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos ...@@ -108,14 +108,15 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aTriangle); drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, aTriangle);
} }
// prepare view-independent LineWidth and color
const drawinglayer::attribute::LineAttribute aLineAttribute(
getColor(),
getDiscreteLineWidth() * getDiscreteUnit());
if ( AS_ALL == maAnchorState || if ( AS_ALL == maAnchorState ||
AS_START == maAnchorState ) AS_START == maAnchorState )
{ {
// create line start // create line start
const drawinglayer::attribute::LineAttribute aLineAttribute(
getColor(),
getLogicLineWidth() / (basegfx::fTools::equalZero(getDiscreteUnit()) ? 1.0 : getDiscreteUnit()));
if(getLineSolid()) if(getLineSolid())
{ {
const drawinglayer::primitive2d::Primitive2DReference aSolidLine( const drawinglayer::primitive2d::Primitive2DReference aSolidLine(
...@@ -194,10 +195,6 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos ...@@ -194,10 +195,6 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorPrimitive::create2DDecompos
{ {
// LineTop has to be created, too, but uses no shadow, so add after // LineTop has to be created, too, but uses no shadow, so add after
// the other parts are created // the other parts are created
const drawinglayer::attribute::LineAttribute aLineAttribute(
getColor(),
getLogicLineWidth() / (basegfx::fTools::equalZero(getDiscreteUnit()) ? 1.0 : getDiscreteUnit()));
const drawinglayer::primitive2d::Primitive2DReference aLineTop( const drawinglayer::primitive2d::Primitive2DReference aLineTop(
new drawinglayer::primitive2d::PolygonStrokePrimitive2D( new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
getLineTop(), getLineTop(),
...@@ -220,7 +217,7 @@ bool AnchorPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive ...@@ -220,7 +217,7 @@ bool AnchorPrimitive::operator==( const drawinglayer::primitive2d::BasePrimitive
&& getLineTop() == rCompare.getLineTop() && getLineTop() == rCompare.getLineTop()
&& getAnchorState() == rCompare.getAnchorState() && getAnchorState() == rCompare.getAnchorState()
&& getColor() == rCompare.getColor() && getColor() == rCompare.getColor()
&& getLogicLineWidth() == rCompare.getLogicLineWidth() && getDiscreteLineWidth() == rCompare.getDiscreteLineWidth()
&& getShadow() == rCompare.getShadow() && getShadow() == rCompare.getShadow()
&& getLineSolid() == rCompare.getLineSolid()); && getLineSolid() == rCompare.getLineSolid());
} }
...@@ -346,13 +343,14 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorOverlayObject::createOverla ...@@ -346,13 +343,14 @@ drawinglayer::primitive2d::Primitive2DSequence AnchorOverlayObject::createOverla
{ {
implEnsureGeometry(); implEnsureGeometry();
static double aDiscreteLineWidth(1.6);
const drawinglayer::primitive2d::Primitive2DReference aReference( const drawinglayer::primitive2d::Primitive2DReference aReference(
new AnchorPrimitive( maTriangle, new AnchorPrimitive( maTriangle,
maLine, maLine,
maLineTop, maLineTop,
GetAnchorState(), GetAnchorState(),
getBaseColor().getBColor(), getBaseColor().getBColor(),
ANCHORLINE_WIDTH * 15.0, ANCHORLINE_WIDTH * aDiscreteLineWidth,
getShadowedEffect(), getShadowedEffect(),
getLineSolid()) ); getLineSolid()) );
......
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