[Kst] branches/work/kst/1.5/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Tue Jun 19 20:11:59 CEST 2007


SVN commit 677685 by arwalker:

CCBUG:111114 Continue with multiple editing of plots

 M  +8 -10     kst2dplot.cpp  
 A             kst2dplotwidget_i.cpp   [License: GPL (v2+)]
 A             kst2dplotwidget_i.h   [License: GPL (v2+)]
 M  +4 -4      ksteditviewobjectdialog_i.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kst2dplot.cpp #677684:677685
@@ -5934,7 +5934,6 @@
       tpx.labels.pop_front();
     }
 
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpx.labels[.]
     for (i = tpx.iLo; i < tpx.iHi; i++) {
       double xTickPos = x_orig_px + (double)i * xtick_px;
       if (_xReversed) {
@@ -5943,16 +5942,16 @@
 
       p.save();
       _xTickLabel->setText(tpx.labels[i - tpx.iLo]);
-      if (_xTickLabel->rotation() == 0) {
+      if (_xTickLabel->rotation() == 0.0) {
         if (!((_suppressLeft  && d2i(xTickPos) - _xTickLabel->size().width() / 2 < xleft_bdr_px ) ||
               (_suppressRight && d2i(xTickPos) - _xTickLabel->size().width() / 2 > x_px - xright_bdr_px ) ) ) {
           p.translate(d2i(xTickPos) - _xTickLabel->size().width() / 2, yTickPos);
           _xTickLabel->paint(p);
         }
-      } else if (_xTickLabel->rotation() > 0) {
+      } else if (_xTickLabel->rotation() > 0.0) {
         p.translate(xTickPos-0.5*_xTickLabel->lineSpacing()*sin(_xTickLabel->rotation()*M_PI/180.0), yTickPos);
         _xTickLabel->paint(p);
-      } else if (_xTickLabel->rotation() < 0) {
+      } else if (_xTickLabel->rotation() < 0.0) {
         p.translate(xTickPos - _xTickLabel->size().width()-0.5*_xTickLabel->lineSpacing()*sin(_xTickLabel->rotation()*M_PI/180.0), yTickPos);
         _xTickLabel->paint(p);
       }
@@ -5961,7 +5960,6 @@
   }
 
   // if top axis is transformed, plot top axis numbers as well
-  // FIXME: inefficient.  We keep reparsing and re-rendering tpx.oppLabels[.]
   if (_xTransformed && !_suppressTop) {
     int yTopTickPos = d2i(ytop_bdr_px);
     if (xTicksOutPlot()) {
@@ -6003,7 +6001,7 @@
     if (yTicksOutPlot()) {
       xTickPos -= d2i(2.0 * ytick_len_px);
     }
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpy.labels[.]
+
     for (i = tpy.iLo; i < tpy.iHi; i++) {
       double yTickPos = y_orig_px - (double)i * ytick_px;
       if (_yReversed) {
@@ -6012,16 +6010,16 @@
       _yTickLabel->setText(tpy.labels[i - tpy.iLo]);
 
       p.save();
-      if (_yTickLabel->rotation() == 0 || _yTickLabel->rotation() <-89 || _yTickLabel->rotation() > 89) {
+      if (_yTickLabel->rotation() == 0.0 || fabs(_yTickLabel->rotation()) > 89.0) {
         if (!((_suppressBottom && d2i(yTickPos) + _yTickLabel->size().height() / 2 > y_px - ybot_bdr_px ) ||
               (_suppressTop    && d2i(yTickPos) - _yTickLabel->size().height() / 2 < ytop_bdr_px ) ) ) {
           p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->size().height() / 2);
           _yTickLabel->paint(p);
         }
-      } else if (_yTickLabel->rotation() < 0) {
+      } else if (_yTickLabel->rotation() < 0.0) {
         p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->lineSpacing()/2);
         _yTickLabel->paint(p);
-      } else if (_yTickLabel->rotation() > 0) {
+      } else if (_yTickLabel->rotation() > 0.0) {
         p.translate(d2i(xTickPos) - _yTickLabel->size().width(), d2i(yTickPos) - _yTickLabel->size().height() + _yTickLabel->lineSpacing()/2);
         _yTickLabel->paint(p);
       }
@@ -6035,7 +6033,7 @@
     if (yTicksOutPlot()) {
       xTopTickPos += d2i(2.0 * ytick_len_px);
     }
-    // FIXME: inefficient.  We keep reparsing and re-rendering tpy.oppLabels[.]
+
     for (i = tpy.iLo; i < tpy.iHi; i++) {
       double yTickPos = y_orig_px - (double)i * ytick_px;
       if (_yReversed) {
--- branches/work/kst/1.5/kst/src/libkstapp/ksteditviewobjectdialog_i.cpp #677684:677685
@@ -522,8 +522,10 @@
     applySettings(_viewObject);
   }
 
-  _apply->setDisabled(true);
-  KstApp::inst()->paintAll(KstPainter::P_PAINT);
+  if (applied) {
+    _apply->setDisabled(true);
+    KstApp::inst()->paintAll(KstPainter::P_PAINT);
+  }
 
   return applied;
 }
@@ -537,8 +539,6 @@
 void KstEditViewObjectDialogI::okClicked() {
   if (_viewObject && apply()) {
     QDialog::accept();
-  } else {
-    QDialog::reject();
   }
 }
 


More information about the Kst mailing list