← Back to team overview

kicad-developers team mailing list archive

Vertical justify of the multiline text

 

Currently alignment of the multiline text applied only for first line and other lines just plased under it. Attached patch allows to align the multiline text given the all lines of the text.

--
Baranovskiy Konstantin
--- kicad/common/eda_text.cpp	2013-10-18 18:12:52.314055000 +0300
+++ kicad/common/eda_text.cpp	2013-10-24 23:28:49.096037503 +0300
@@ -227,6 +227,23 @@
 
         offset.y = GetInterline();
 
+        if( list->Count() > 1 )
+        {
+            switch( m_VJustify )
+            {
+            case GR_TEXT_VJUSTIFY_TOP:
+                break;
+
+            case GR_TEXT_VJUSTIFY_CENTER:
+                pos.y -= ( list->Count() - 1 ) * offset.y / 2;
+                break;
+
+            case GR_TEXT_VJUSTIFY_BOTTOM:
+                pos.y -= ( list->Count() - 1 ) * offset.y;
+                break;
+            }
+        }
+
         RotatePoint( &offset, m_Orient );
 
         for( unsigned i = 0; i<list->Count(); i++ )

Follow ups