You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/06/14 14:02:40 UTC
svn commit: r1493049 - in /openoffice/trunk/main/drawinglayer/source:
primitive2d/primitivetools2d.cxx processor2d/vclprocessor2d.cxx
Author: alg
Date: Fri Jun 14 12:02:40 2013
New Revision: 1493049
URL: http://svn.apache.org/r1493049
Log:
i12525 use X and Y for unit evaluation
Modified:
openoffice/trunk/main/drawinglayer/source/primitive2d/primitivetools2d.cxx
openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
Modified: openoffice/trunk/main/drawinglayer/source/primitive2d/primitivetools2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/primitive2d/primitivetools2d.cxx?rev=1493049&r1=1493048&r2=1493049&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/primitive2d/primitivetools2d.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/primitive2d/primitivetools2d.cxx Fri Jun 14 12:02:40 2013
@@ -38,8 +38,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()))
{
Modified: openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx?rev=1493049&r1=1493048&r2=1493049&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx Fri Jun 14 12:02:40 2013
@@ -1279,7 +1279,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));
@@ -1321,7 +1322,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));