Author: alg
Date: Mon Jul  8 10:30:37 2013
New Revision: 1500644

URL: http://svn.apache.org/r1500644
Log:
corrected warnings and numerical inconsequence in gradient fallback render 
handling

Modified:
    
openoffice/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
    
openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
    openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx

Modified: 
openoffice/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx?rev=1500644&r1=1500643&r2=1500644&view=diff
==============================================================================
--- 
openoffice/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
 (original)
+++ 
openoffice/trunk/main/drawinglayer/inc/drawinglayer/primitive2d/svggradientprimitive2d.hxx
 Mon Jul  8 10:30:37 2013
@@ -158,6 +158,7 @@ namespace drawinglayer
                 const basegfx::B2DPoint& rStart,
                 bool bUseUnitCoordinates,
                 SpreadMethod aSpreadMethod = Spread_pad);
+            virtual ~SvgGradientHelper();
 
             /// data read access
             const basegfx::B2DHomMatrix& getGradientTransform() const { return 
maGradientTransform; }
@@ -168,7 +169,7 @@ namespace drawinglayer
             SpreadMethod getSpreadMethod() const { return maSpreadMethod; }
 
             /// compare operator
-            virtual bool operator==(const SvgGradientHelper& 
rSvgGradientHelper) const;
+            bool operator==(const SvgGradientHelper& rSvgGradientHelper) const;
         };
     } // end of namespace primitive2d
 } // end of namespace drawinglayer

Modified: 
openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx?rev=1500644&r1=1500643&r2=1500644&view=diff
==============================================================================
--- 
openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
 (original)
+++ 
openoffice/trunk/main/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
 Mon Jul  8 10:30:37 2013
@@ -304,6 +304,10 @@ namespace drawinglayer
         {
         }
 
+        SvgGradientHelper::~SvgGradientHelper()
+        {
+        }
+
         bool SvgGradientHelper::operator==(const SvgGradientHelper& 
rSvgGradientHelper) const
         {
             const SvgGradientHelper& rCompare = static_cast< const 
SvgGradientHelper& >(rSvgGradientHelper);

Modified: 
openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx?rev=1500644&r1=1500643&r2=1500644&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx 
(original)
+++ openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx 
Mon Jul  8 10:30:37 2013
@@ -1279,8 +1279,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));
@@ -1322,8 +1324,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));


Reply via email to