[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Wed Jul 28 17:39:07 CEST 2004


CVS commit by netterfield: 

Dragging of multi-line text now works.
	-There are DnD problems with rotated text (seems like a previous bug)
	-Line spacing takes no account of super and sub scripts (wontfix)

Since this is just a hack until viewlabels are implemented, I'm not inclined to
do much more on it.  


  M +10 -2     kstlabel.cpp   1.36


--- kdeextragear-2/kst/kst/kstlabel.cpp  #1.35:1.36
@@ -172,4 +172,5 @@ void KstLabel::draw(QPainter &p, int px,
   double x0;
   int i_g;
+  int n_cr = 0;
   bool is_greek;
   bool bTerminate = false;
@@ -395,4 +397,8 @@ void KstLabel::draw(QPainter &p, int px,
           } else if (processedText[i+1] == 'n') {
             // New Line here
+            if ( n_cr == 0 ) {
+              v_offset = ( y-y_upper );
+            }
+            n_cr++;
             if (Width < (x-x0)) {
               Width = x - x0;
@@ -400,5 +406,5 @@ void KstLabel::draw(QPainter &p, int px,
             x = x0;
             y += 1.5*h;
-            //y_lower -= 1.5*h;
+
             i++;
             if (processedText.at(i+1) == ' ') {
@@ -472,5 +478,7 @@ void KstLabel::draw(QPainter &p, int px,
   rect.normalize( );
 
+  if ( n_cr==0 ) {
   v_offset = (int)(y - y_upper);
+  }
 
   if( Rotation == 0.0 ) {





More information about the Kst mailing list