diff options
author | Armin Le Grand <alg@apache.org> | 2013-06-14 12:02:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-14 16:03:33 +0100 |
commit | 9d491e73168cc21ed9f6fc7a596e8b4aec320a9b (patch) | |
tree | 972f62e246de4e6228208c7b02fbd6dc0d95863e /drawinglayer | |
parent | b464ca01387bc9063888f4caac497982605fecf8 (diff) |
Resolves: #i122525# use X and Y for unit evaluation
(cherry picked from commit a34f3fdf50dbf8eac0599dfb018fc0040ef2a2f0)
Change-Id: Icdb83829917315173be5e824083ed502f6a6a8cb
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/primitivetools2d.cxx | 5 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drawinglayer/source/primitive2d/primitivetools2d.cxx b/drawinglayer/source/primitive2d/primitivetools2d.cxx index 063aa1cc073e..f1998e75a25a 100644 --- a/drawinglayer/source/primitive2d/primitivetools2d.cxx +++ b/drawinglayer/source/primitive2d/primitivetools2d.cxx @@ -31,8 +31,9 @@ namespace drawinglayer { ::osl::MutexGuard aGuard( m_aMutex ); - // get the current DiscreteUnit - const double fDiscreteUnit((rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); + // get the current DiscreteUnit, look at X and Y and use the maximum + const basegfx::B2DVector aDiscreteVector(rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); + const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), fabs(aDiscreteVector.getY()))); if(getBuffered2DDecomposition().hasElements() && !basegfx::fTools::equal(fDiscreteUnit, getDiscreteUnit())) { diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 02b80cc5a851..a11c49b0fe4c 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -1396,7 +1396,8 @@ namespace drawinglayer { const basegfx::BColor aColorA(maBColorModifierStack.getModifiedColor(rCandidate.getColorA())); const basegfx::BColor aColorB(maBColorModifierStack.getModifiedColor(rCandidate.getColorB())); - const double fDiscreteUnit((getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); + const basegfx::B2DVector aDiscreteVector(getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); + const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), fabs(aDiscreteVector.getY()))); // use color distance and discrete lengths to calculate step count const sal_uInt32 nSteps(calculateStepsForSvgGradient(aColorA, aColorB, fDelta, fDiscreteUnit)); @@ -1438,7 +1439,8 @@ namespace drawinglayer { const basegfx::BColor aColorA(maBColorModifierStack.getModifiedColor(rCandidate.getColorA())); const basegfx::BColor aColorB(maBColorModifierStack.getModifiedColor(rCandidate.getColorB())); - const double fDiscreteUnit((getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)).getLength()); + const basegfx::B2DVector aDiscreteVector(getViewInformation2D().getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 1.0)); + const double fDiscreteUnit(std::min(fabs(aDiscreteVector.getX()), fabs(aDiscreteVector.getY()))); // use color distance and discrete lengths to calculate step count const sal_uInt32 nSteps(calculateStepsForSvgGradient(aColorA, aColorB, fDeltaScale, fDiscreteUnit)); |