]> git.mxchange.org Git - flightgear.git/commitdiff
Rename tf elements for easier handling.
authorThomas Geymayer <tomgey@gmail.com>
Wed, 11 Jul 2012 11:21:58 +0000 (13:21 +0200)
committerJames Turner <zakalawe@mac.com>
Fri, 13 Jul 2012 10:11:29 +0000 (11:11 +0100)
docs-mini/README.canvas
src/Canvas/elements/element.cxx

index 8cc0b3004d84c5950c6c0caa2e814997cdf8aac8..a83865e10f95e57e214e1004adac0b0ec8000413 100644 (file)
@@ -76,14 +76,16 @@ only drawing Text is possible:
  <character-aspect-ratio type="float">  Ratio between character height and width
                                         (default: 1)
  <tf>               A 3x3 transformation matrix specified by 6 values
-                    (child elements <a>, ..., <f>) See
+                    (child elements <m n="0">, ..., <m n="5"> which equal to a,
+                     ...,f used in the SVG standard) See
                     http://www.w3.org/TR/SVG/coords.html#TransformMatrixDefined
                     for details.
                     You can also use shortcuts and use an alternative to
                     specifying six values:
-                     - Translation: <tx>, <ty> (ty, ty default to 0)
-                     - Totation: <rot>
-                     - Scale: <sx>, <sy> (sx is required, sy defaults to sx)
+                     - Translation: <t n="0">, <t n="1"> (both default to 0)
+                     - Rotation: <rot>
+                     - Scale: <s n="0">, <s n="1"> (s[0] is required, s[1]
+                                                    defaults to s[0])
  <alginment type="string">   Text alignment (default: "left-baseline") One of:
 
                               "left-top"
index 1695449aa0c85d16c937ec918f0dddb7d15279d4..3c2cdc64b386e69d242c22a5fd03c4be4dfe4b01 100644 (file)
@@ -56,19 +56,19 @@ namespace canvas
         switch( _transform_types[i] )
         {
           case TT_MATRIX:
-            tf = osg::Matrix( tf_node->getDoubleValue("a", 1),
-                              tf_node->getDoubleValue("b", 0), 0, 0,
+            tf = osg::Matrix( tf_node->getDoubleValue("m[0]", 1),
+                              tf_node->getDoubleValue("m[1]", 0), 0, 0,
 
-                              tf_node->getDoubleValue("c", 0),
-                              tf_node->getDoubleValue("d", 1), 0, 0,
+                              tf_node->getDoubleValue("m[2]", 0),
+                              tf_node->getDoubleValue("m[3]", 1), 0, 0,
 
                               0,    0,    1, 0,
-                              tf_node->getDoubleValue("e", 0),
-                              tf_node->getDoubleValue("f", 0), 0, 1 );
+                              tf_node->getDoubleValue("m[4]", 0),
+                              tf_node->getDoubleValue("m[5]", 0), 0, 1 );
             break;
           case TT_TRANSLATE:
-            tf.makeTranslate( osg::Vec3f( tf_node->getDoubleValue("tx", 0),
-                                          tf_node->getDoubleValue("ty", 0),
+            tf.makeTranslate( osg::Vec3f( tf_node->getDoubleValue("t[0]", 0),
+                                          tf_node->getDoubleValue("t[1]", 0),
                                           0 ) );
             break;
           case TT_ROTATE:
@@ -76,9 +76,9 @@ namespace canvas
             break;
           case TT_SCALE:
           {
-            float sx = tf_node->getDoubleValue("sx", 1);
+            float sx = tf_node->getDoubleValue("s[0]", 1);
             // sy defaults to sx...
-            tf.makeScale( sx, tf_node->getDoubleValue("sy", sx), 1 );
+            tf.makeScale( sx, tf_node->getDoubleValue("s[1]", sx), 1 );
             break;
           }
           default:
@@ -151,14 +151,13 @@ namespace canvas
 
       TransformType& type = _transform_types[parent->getIndex()];
 
-      if(    name == "a" || name == "b" || name == "c"
-          || name == "d" || name == "e" || name == "f" )
+      if(      name == "m" )
         type = TT_MATRIX;
-      else if( name == "tx" || name == "ty" )
+      else if( name == "t" )
         type = TT_TRANSLATE;
       else if( name == "rot" )
         type = TT_ROTATE;
-      else if( name == "sx" || name == "sy" )
+      else if( name == "s" )
         type = TT_SCALE;
       else
         SG_LOG