diff options
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 10 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx index 66d21f037f2a..d9ca6e19f8ca 100644 --- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx @@ -299,7 +299,11 @@ namespace drawinglayer { } - bool SvgGradientHelper::equalTo(const SvgGradientHelper& rSvgGradientHelper) const + SvgGradientHelper::~SvgGradientHelper() + { + } + + bool SvgGradientHelper::operator==(const SvgGradientHelper& rSvgGradientHelper) const { const SvgGradientHelper& rCompare = static_cast< const SvgGradientHelper& >(rSvgGradientHelper); @@ -578,7 +582,7 @@ namespace drawinglayer { const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive); - if(pSvgGradientHelper && SvgGradientHelper::equalTo(*pSvgGradientHelper)) + if(pSvgGradientHelper && SvgGradientHelper::operator==(*pSvgGradientHelper)) { const SvgLinearGradientPrimitive2D& rCompare = static_cast< const SvgLinearGradientPrimitive2D& >(rPrimitive); @@ -878,7 +882,7 @@ namespace drawinglayer { const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive); - if(pSvgGradientHelper && SvgGradientHelper::equalTo(*pSvgGradientHelper)) + if(pSvgGradientHelper && SvgGradientHelper::operator==(*pSvgGradientHelper)) { const SvgRadialGradientPrimitive2D& rCompare = static_cast< const SvgRadialGradientPrimitive2D& >(rPrimitive); diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 1ec9f50dc53e..86c51b2c7d2e 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -1396,8 +1396,10 @@ namespace drawinglayer { const basegfx::BColor aColorA(maBColorModifierStack.getModifiedColor(rCandidate.getColorA())); const basegfx::BColor aColorB(maBColorModifierStack.getModifiedColor(rCandidate.getColorB())); + + // calculate discrete unit in WorldCoordinates; use diagonal (1.0, 1.0) and divide by sqrt(2) const basegfx::B2DVector aDiscreteVector(getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); - const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), fabs(aDiscreteVector.getY()))); + const double fDiscreteUnit(aDiscreteVector.getLength() * (1.0 / 1.414213562373)); // use color distance and discrete lengths to calculate step count const sal_uInt32 nSteps(calculateStepsForSvgGradient(aColorA, aColorB, fDelta, fDiscreteUnit)); @@ -1439,8 +1441,10 @@ namespace drawinglayer { const basegfx::BColor aColorA(maBColorModifierStack.getModifiedColor(rCandidate.getColorA())); const basegfx::BColor aColorB(maBColorModifierStack.getModifiedColor(rCandidate.getColorB())); + + // calculate discrete unit in WorldCoordinates; use diagonal (1.0, 1.0) and divide by sqrt(2) const basegfx::B2DVector aDiscreteVector(getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); - const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), fabs(aDiscreteVector.getY()))); + const double fDiscreteUnit(aDiscreteVector.getLength() * (1.0 / 1.414213562373)); // use color distance and discrete lengths to calculate step count const sal_uInt32 nSteps(calculateStepsForSvgGradient(aColorA, aColorB, fDeltaScale, fDiscreteUnit)); |