[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegraphics/ksvg
From:       Adrian Page <Adrian.Page () tesco ! net>
Date:       2003-10-30 18:02:54
[Download RAW message or body]

CVS commit by page: 

Fix default values for fx and fy when using userSpaceOnUse. Fixes batik's \
batikYin.svg main gradient and the gradient on the ball in the image.svg test.


  M +0 -16     impl/SVGRadialGradientElementImpl.cc   1.105
  M +15 -2     plugin/backends/libart/LibartCanvasItems.cpp   1.96


--- kdegraphics/ksvg/impl/SVGRadialGradientElementImpl.cc  #1.104:1.105
@@ -156,15 +156,7 @@ void SVGRadialGradientElementImpl::putVa
         {
                 case Cx:
-                        // Special case: As this value may be needed to assign a \
                value to 'fx'
-                        //               we need to set it manually first, as if it \
                would be
-                        //                               an userspace value
-                        \
                cx()->baseVal()->setValueAsString(value.toString(exec).qstring());
                         converter()->modify(cx(), value.toString(exec).qstring());
                         break;
                 case Cy:
-                        // Special case: As this value may be needed to assign a \
                value to 'fy'
-                        //               we need to set it manually first, as if it \
                would be
-                        //                               an userspace value
-                        \
                cy()->baseVal()->setValueAsString(value.toString(exec).qstring());
                         converter()->modify(cy(), value.toString(exec).qstring());
                         break;
@@ -198,12 +190,4 @@ void SVGRadialGradientElementImpl::setAt
         if(KSVG_TOKEN_NOT_PARSED(R))
                 KSVG_SET_ALT_ATTRIBUTE(R, "50%")
-
-        // Spec: if fx is not specified, fx will coincide with cx
-        if(KSVG_TOKEN_NOT_PARSED(Fx))
-                KSVG_SET_ALT_ATTRIBUTE(Fx, \
SVGLengthImpl::convertValToPercentage(QString::number(cx()->baseVal()->valueInSpecifiedUnits()), \
                100.0))
-
-        // Spec: if fy is not specified, fy will coincide with cy
-        if(KSVG_TOKEN_NOT_PARSED(Fy))
-                KSVG_SET_ALT_ATTRIBUTE(Fy, \
SVGLengthImpl::convertValToPercentage(QString::number(cy()->baseVal()->valueInSpecifiedUnits()), \
100.0))  }
 

--- kdegraphics/ksvg/plugin/backends/libart/LibartCanvasItems.cpp  #1.95:1.96
@@ -2196,7 +2196,20 @@ void LibartRadialGradient::render(KSVGCa
                 double _cx = m_radial->cx()->baseVal()->value();
                 double _cy = m_radial->cy()->baseVal()->value();
-                double _fx = m_radial->fx()->baseVal()->value();
-                double _fy = m_radial->fy()->baseVal()->value();
                 double _r = m_radial->r()->baseVal()->value();
+                
+                double _fx;
+                double _fy;
+
+                // Spec: If attribute fx is not specified, fx will coincide with cx.
+                if(m_radial->getAttribute("fx").isEmpty())
+                        _fx = _cx;
+                else
+                        _fx = m_radial->fx()->baseVal()->value();
+
+                // Spec: If attribute fy is not specified, fy will coincide with cy.
+                if(m_radial->getAttribute("fy").isEmpty())
+                        _fy = _cy;
+                else
+                        _fy = m_radial->fy()->baseVal()->value();
 
                 const double epsilon = std::numeric_limits<double>::epsilon();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic