]> git.mxchange.org Git - simgear.git/commitdiff
Canvas::Text: add line-height property.
authorThomas Geymayer <tomgey@gmail.com>
Fri, 19 Jul 2013 21:38:08 +0000 (23:38 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Fri, 19 Jul 2013 21:38:08 +0000 (23:38 +0200)
simgear/canvas/elements/CanvasText.cxx

index e04ff79e7adc5630bf83bb4c79dfd5275e0f72cc..615eb05218af82c655c172f7c230669aa2573450 100644 (file)
@@ -36,6 +36,7 @@ namespace canvas
 
       void setFontResolution(int res);
       void setCharacterAspect(float aspect);
+      void setLineHeight(float factor);
       void setFill(const std::string& fill);
       void setBackgroundColor(const std::string& fill);
 
@@ -69,6 +70,12 @@ namespace canvas
     setCharacterSize(getCharacterHeight(), aspect);
   }
 
+  //----------------------------------------------------------------------------
+  void Text::TextOSG::setLineHeight(float factor)
+  {
+    setLineSpacing(factor - 1);
+  }
+
   //----------------------------------------------------------------------------
   void Text::TextOSG::setFill(const std::string& fill)
   {
@@ -282,6 +289,7 @@ namespace canvas
       addStyle("character-aspect-ratio",
                "numeric",
                &TextOSG::setCharacterAspect, text);
+      addStyle("line-height", "numeric", &TextOSG::setLineHeight, text);
       addStyle("font-resolution", "numeric", &TextOSG::setFontResolution, text);
       addStyle("padding", "numeric", &TextOSG::setBoundingBoxMargin, text);
       //  TEXT              = 1 default