[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Jul 22 22:50:08 CEST 2005


SVN commit 437713 by arwalker:

Need to reset the labels if a plot has been resized, to ensure the plot alignment and margins are correctly calculated.

 M  +7 -7      kst2dplot.cpp  
 M  +7 -0      kstlabel.cpp  
 M  +1 -0      kstlabel.h  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #437712:437713
@@ -2086,13 +2086,13 @@
   y_px = p.window().height();
 
   if (_oldSize != size()) {
-    XLabel->setSize(XLabel->size());
-    YLabel->setSize(YLabel->size());
-    TopLabel->setSize(TopLabel->size());
-    XTickLabel->setSize(XTickLabel->size());
-    YTickLabel->setSize(YTickLabel->size());
-    XFullTickLabel->setSize(XFullTickLabel->size());
-    YFullTickLabel->setSize(YFullTickLabel->size());
+    XLabel->resize();
+    YLabel->resize();
+    TopLabel->resize();
+    XTickLabel->resize();
+    YTickLabel->resize();
+    XFullTickLabel->resize();
+    YFullTickLabel->resize();
   }
 
   rectWindow = p.window();
--- trunk/extragear/graphics/kst/kst/kstlabel.cpp #437712:437713
@@ -767,6 +767,13 @@
 }
 
 
+void KstLabel::resize( ) {
+  Width = -1; // invalidate the width
+  LineSpacing = -1;
+  setDirty();
+}
+
+
 void KstLabel::setSize(int in_size) {
   if (in_size != Size) {
     Width = -1; // invalidate the width
--- trunk/extragear/graphics/kst/kst/kstlabel.h #437712:437713
@@ -75,6 +75,7 @@
     void setInterpreted(bool interpreted);
     bool interpreted() const;
 
+    void resize();
     void setSize(int size);
     void setFontName(const QString& fontName);
     QString fontName() const;


More information about the Kst mailing list